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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
learner03
Post Partisan
Post Partisan

pie chart based on count

I have these two columns in the report- I want Pie chart based on count of the rows of months column where months value is between 1-2 then3 and 6,6-10 and rest more than 10. And showing sum of dollar value in the pie chart in their respective region.

Cost Months
$481,948 8
$399,263 25
$295,784 36
$229,014 25
$191,070 8
$188,109 8
$147,928 4
$136,728 2
$106,519 5
$102,782 10
$77,583 5
$92,820 7
$82,212 6
$76,248 9
$68,529 3
$71,543 34
$53,061 4
$49,058 6
$25,054 42
$19,115 12
$20,128 2
$21,550 20
5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @learner03 

 

You can add a calculated column with below DAX in the original table, then use it to create a pie chart like below. Is this what you want? "Sum of Cost" will display in the pop-up tooltip once the mouse cursor hovers over a sector. 

Month Group = 
SWITCH(TRUE(),
    'Table'[Months]<=2, "1-2",
    'Table'[Months]<=6, "3-6",
    'Table'[Months]<=10, "7-10",
    "> 10"
)

vjingzhang_0-1675649901305.png

vjingzhang_1-1675650071551.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hi @v-jingzhang  Can I do this in some way using a measure because my stock cover and Cost is a measure and not a direct column in the table?

Hi @learner03 

I'm not sure without knowing how the data is like. Can you provide some sample data in table format and the DAX formula of those measures? And which fields do you want to place into the pie chart?

BR,

Jing

amitchandak
Super User
Super User

@learner03 , are you looking for count bucketing?

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

@amitchandak I followed your video but mine is below output-

akapoor03_0-1675400205758.png

Where am I doing wrong?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.