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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

pareto calculations

Hi all, here i am trying to calculate pareto calculations based on region.

jahir12_0-1669025373291.png
consider if a rank is selected at 50% then i need to calculate the top 50 items sum in the region level and the top 50 items need to be displayed too, if the rank is 90%, then  i need to calculate sum for the top 90 items in the region level and the top 90 items need to be displayed too. Rank is dynamic, so how can i achive it in power bi, when the slicer is selected, then according to slicer (rank) selection, i need to calculate top items sum on region levels and those items need to be displayed. Please help me out with this.

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1669099535454.png

Here are the steps you can follow:

1. Modeling – New parameter -- Set the interval size.

vyangliumsft_1-1669099535458.png

2. Create measure.

Rank =
RANKX(FILTER(ALL('Table'),'Table'[Region]=MAX('Table'[Region])),CALCULATE(SUM('Table'[Value])),,DESC,Dense)
Flag =
var _top=SELECTEDVALUE('Parameter'[Parameter])
return
IF(
    [Rank]<=_top,1,0)
Rank =
RANKX(FILTER(ALL('Table'),'Table'[Region]=MAX('Table'[Region])),CALCULATE(SUM('Table'[Value])),,DESC,Dense)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1669099535458.png

4. Result:

vyangliumsft_3-1669099535462.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1669099535454.png

Here are the steps you can follow:

1. Modeling – New parameter -- Set the interval size.

vyangliumsft_1-1669099535458.png

2. Create measure.

Rank =
RANKX(FILTER(ALL('Table'),'Table'[Region]=MAX('Table'[Region])),CALCULATE(SUM('Table'[Value])),,DESC,Dense)
Flag =
var _top=SELECTEDVALUE('Parameter'[Parameter])
return
IF(
    [Rank]<=_top,1,0)
Rank =
RANKX(FILTER(ALL('Table'),'Table'[Region]=MAX('Table'[Region])),CALCULATE(SUM('Table'[Value])),,DESC,Dense)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1669099535458.png

4. Result:

vyangliumsft_3-1669099535462.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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.