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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
VinnuVas
New Member

To display Overall Rank when filter by product based on slicer selection

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @VinnuVas 

May I ask if this is the expected output you are looking for? Based on your description, I have created a measure to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1705389696619.png

Measures:

Sales Rank =

VAR _allProduct =

    CALCULATE ( COUNTROWS ( ALL ( 'Table' ) ) )

VAR _rank =

    RANKX (

        ALL ( 'Table'[Product] ),

        CALCULATE ( SUM ( 'Table'[Sales] ) ),

        ,

        DESC,

        DENSE

    )

RETURN

    IF ( ISFILTERED ( 'Table'[Product] ), _rank & "  Out of  " & _allProduct )

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi, @VinnuVas 

May I ask if this is the expected output you are looking for? Based on your description, I have created a measure to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1705389696619.png

Measures:

Sales Rank =

VAR _allProduct =

    CALCULATE ( COUNTROWS ( ALL ( 'Table' ) ) )

VAR _rank =

    RANKX (

        ALL ( 'Table'[Product] ),

        CALCULATE ( SUM ( 'Table'[Sales] ) ),

        ,

        DESC,

        DENSE

    )

RETURN

    IF ( ISFILTERED ( 'Table'[Product] ), _rank & "  Out of  " & _allProduct )

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Daniel29195
Super User
Super User

@VinnuVas ,

if you want to create w rank measure , that takes into account the slicer selection, 

try this  ; 
rankx(

allselected(table_name[column_name])
, [ Sales amount]

 

)

 

if what you want shouldnt take into consideration the slicer selections, simply replace allselected with all

 

 

hope this helps

 

 

Ritaf1983
Super User
Super User

Hi @VinnuVas 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

ProductSalesQuantityCategory
Dell24015Business
HP36018Business
Lenovo48032Gaming
Acer57040Gaming
Apple18012General

@Ritaf1983 

And what are you ranking here?

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

firstly we calculated total sales and will show the rank of product

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors