Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ohohbudi
Frequent Visitor

How to group data

Hello, I want to ask how to group the data. I have discount product data which contains discount number from 0 - 150 like this : 

Discount List.png

And i want to make a pie chart that only will be divided into 2 categories : '0%' and 'Not 0% Discount'. Then, if I click the the pie chart on 'Not 0% Discount', there will be a table that will show all the discounts percentage > 0% list (1%, 3%, 5%, 7%, etc)

 

Whether i have to make a measure or column to make it? And then how the content of that measure/column? 

 

Really hope your all help, Thank you. 

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @ohohbudi,

>>I want to create a pie chart divided into 2 categories : '0%' and 'Not 0% Discount'. Then, if I click the the pie chart on 'Not 0% Discount', there will be a table that will show all the discounts percentage > 0% list (1%, 3%, 5%, 7%, etc)

 

For your requriement, I try to reproduce and get expected result.

I create sample table.

1.PNG

I create a calculated column to  get percentage ([Diskon Product]/[Total Product]). Then use IF...ELSE function to judge if the percentage is 0.

Percentage = Table2[Diskon]/CALCULATE(SUM(Table2[Diskon]),ALL(Table2))

Tag = IF(Table2[Percentage]=0,"0%","Not 0% Discount")

 

 

2.PNG

Create a Pie Chart and Table visual. Please view the following screenshot. The green part show the count of 0 percents, and the back part shows the not 0 percents.

3.png5.PNG

When you click the 0%, it will list the 0 %. Otherwise, it will returns other results.

11.PNG12.PNG
Please let me know  if you have any issue.

Best Regards,
Angelia


View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @ohohbudi,

>>I want to create a pie chart divided into 2 categories : '0%' and 'Not 0% Discount'. Then, if I click the the pie chart on 'Not 0% Discount', there will be a table that will show all the discounts percentage > 0% list (1%, 3%, 5%, 7%, etc)

 

For your requriement, I try to reproduce and get expected result.

I create sample table.

1.PNG

I create a calculated column to  get percentage ([Diskon Product]/[Total Product]). Then use IF...ELSE function to judge if the percentage is 0.

Percentage = Table2[Diskon]/CALCULATE(SUM(Table2[Diskon]),ALL(Table2))

Tag = IF(Table2[Percentage]=0,"0%","Not 0% Discount")

 

 

2.PNG

Create a Pie Chart and Table visual. Please view the following screenshot. The green part show the count of 0 percents, and the back part shows the not 0 percents.

3.png5.PNG

When you click the 0%, it will list the 0 %. Otherwise, it will returns other results.

11.PNG12.PNG
Please let me know  if you have any issue.

Best Regards,
Angelia


MalS
Resolver III
Resolver III

Click on your discount field in the field list on the right, then on the ribbon click on Modeling > New Group. Set group type to List, then click on the 0 and click the Group button. That's your 0% group. There should also be an 'Other' group that will automatically contain everything else (which you can rename if you like). Click OK and the group will show up as a new field that you can add to your pie chart, etc.

 

If you add a table with the discount field it will list all of the discounts (make sure you set it to Don't Summarize), then when you click on the pie chart it will automatically filter the table the way you want. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.