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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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