web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get a Pie Chart to cou...
Power Apps
Answered

Get a Pie Chart to count based on conditions in another column

(0) ShareShare
ReportReport
Posted on by 5

I have a Power App that pulls data from an excel file.  I want to build a pie chart that only pulls data from one column based on another column with a "yes" in the selected cell. 

 

I have a Pie Chart that can count the column, but I need to show this data, filtered by another column.  Here is the code in "Items" and the Pie chart I have already.

 
AddColumns(GroupBy(Table1, "Delta / Full FAI", "DFF"), "TotalDFF", CountRows(DFF), "DFF1", Concatenate('Delta / Full FAI', " - ", Text (CountRows(DFF))))
Tim24_0-1712253010465.png

 

Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Tim24 

    Can you share your data and the end result you want to get in your pie chart ?

     

    Best Regards,

    Yueyun Zhang

  • Tim24 Profile Picture
    5 on at

    Unfortunately I cant share the data, but I want the pie chart to show a subset of the overall data based on another column, with "Yes" or "No" in the other column.  I would think it is the equivalent to a CountIf function, but I can't get it to work in Power Apps.

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Tim24 

    Thanks for your response! This is my test data and the result:

    ClearCollect(Table1Test , { 'Delta / Full FAI' : "DETLA" , Flag : "yes" }, { 'Delta / Full FAI' : "DETLA" , Flag : "yes" }, { 'Delta / Full FAI' : "DETLA" , Flag : "yes" }, { 'Delta / Full FAI' : "DETLA" , Flag : "yes" }, { 'Delta / Full FAI' : "DETLA" , Flag : "no" } ,  { 'Delta / Full FAI' : "FULL" , Flag : "yes" },{ 'Delta / Full FAI' : "FULL" , Flag : "no" } , { 'Delta / Full FAI' : "-" , Flag : "yes" },{ 'Delta / Full FAI' : "*" , Flag : "no" } )

    vyueyunmsft_0-1712710587693.jpeg

     

    My Combo box 1 -items:   ["yes","no"]

    I use this code in PieChart - items:

    AddColumns( GroupBy(Table1Test , "Delta / Full FAI" , "DFF" )  , "TotalDFF" , CountIf( DFF ,Flag= ComboBox1.Selected.Value) , "DFF1" , Concatenate('Delta / Full FAI', " - ", CountIf( DFF ,Flag= ComboBox1.Selected.Value) )  )

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard