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
Barendnu
Advocate III
Advocate III

Show not TOP5 but TOP6-10 results, based on a calculated value

Hi all,

 

We have a couple of graphs in which we show the top10, but that shows a lot of data in one graph.

Is there a way to show this in two separate visuals (visual1: 1to5, visual2: 6to10)?

 

Our graph uses a measure to calculate % positive: 

%_Positive = CALCULATE(COUNT(Sample[Respondent]); Sample[ScaleAnswer] > 5)/CALCULATE(count(Sample[Respondent]))
Currently, we use the built in topN filter to show only the top10:
top.PNG
 
This works perfectly, but because of the limited screen size we'd like to split this in two graphs.
So top5 in one graph, and the remaining items of the top10 in another graph.
 
I already played around with dax TOPN and RANKX, but could not get it to work combined with our %_Positive measure. See sample .pbix here: http://www3.e-research.nl/images/PowerBI/SampleTopN.pbix. Any suggestions would be greatly appreciated!
1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Barendnu

 

Try using this MEASURE as VISUAL filter.

See file attached as well

 

RANK =
RANKX ( ALLSELECTED ( 'Sample'[Subject] ), [%_Positive],, DESC, SKIP )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Barendnu

 

Try using this MEASURE as VISUAL filter.

See file attached as well

 

RANK =
RANKX ( ALLSELECTED ( 'Sample'[Subject] ), [%_Positive],, DESC, SKIP )

Regards
Zubair

Please try my custom visuals

Thanks for the good and fast answer!

 

In our 'real' setup, we had another related table that provided the legend items in the graph, so I added a CALCULATE + ALL to combine the ranking of all legend items combined:

 

 
 
RANK = RANKX(ALLSELECTED('Sample'[Subject]);CALCULATE([%_Positive];ALL('Legend items'[Legend item value]));;DESC;Skip)

 

 

Rank.png

 

Works like a charm now 🙂

 

 

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.