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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
UditJ
Helper III
Helper III

Need to Find Top N for Table with Multiple Measures

I have a table with Site Names and Multiple Measures ( Impressions , Click ...) as shown below:
Table Name.PNG

Need to find top 5/10/15 Site Names. I am able to calculate for a single measure using the below formula: 

TopN Sites =
VAR SelectedTop = SELECTEDVALUE('TopN Sites'[TopN Sites])
RETURN
SWITCH(TRUE(),
    SelectedTop =  [Total Impressions],[Total Clicks],
    RANKX(
            ALLSELECTED(  'Visualization_Library'[Site Name]),
       
            [Total Impressions]
                )
                  <= SelectedTop,
        [Total Impressions]
)

WHen i am adding multiple measures in the above formula , i am not getting the desired output. Any suggestions ?
2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @UditJ ,

 

If you want to only get the TOP N based on one measure, use the TOP N filter.

vstephenmsft_1-1668590221838.png

If you want to sort based on multiple columns, you can get a single Rankin result separately, and then combine them together to get a final ranking result. Then put the ranking measure into TOP N filter.

 

 

Best Regards,

Stephen Tao

 

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

 

Hello , 

i want the top n as a slicer where i am able to choose the top 5. top 10 . top 15 and top 20. Is there any way where i can get the top n slicer based on multiple measures  ?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.