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
Dunner2020
Post Prodigy
Post Prodigy

80-20% pie chart distribution

Hi there,

 

I got data on events that occurred in different areas. I have a measure that calculates no of events occurred in different areas. The measure looks like:

 

no of events  = calculate( countx(filter(table, table[Event date]<=Today()), table[event id]))

 

I create the meaure for ranking:

Rank = RANKX(ALLSELECTED('Table'[AreaCode]),[No of Interruptions],,DESC,Skip)

 

Then I create another measure that calculates the cumulative sum of no of events:

 

cumulative sum = 

Var Total_incidents = [No of Interruptions]
Var currentRank = [Rank]
Return
SUMX(FILTER(ALLSELECTED('Table'[AreaCode]),[Rank]<=currentRank),[No of events])
 
 
Now, I am trying to create a pie chart that displays Pareto distribution in such a way that it shows the name of those areas that contribute to 80% of total events whereas show 'others' (not the name of area) for the remaining 20%.  
 
Pie_chart = 
Var total_events = [No of events]
Var cal_percent = [cumulative sum] /total_events
return
IF(cal_percent <= 0.8, Max('Table'[AreaCode]),"Others")
 
However, it's not producing the desired output. I am not sure where am I making the mistake. Any help would be really appreciated. Data can be download from here 
1 ACCEPTED SOLUTION
2 REPLIES 2

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.