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
DerekRadue
Frequent Visitor

Ranking - masking non selected Items

Hi

 

I have data similar to the table below

 KPI 1KPI 2KPI 3
Store A  30030522
Store B10075174
Store C2001587
Store D40045348
Store E50090435
Store F60060261

 

And would like to show it as per the example below

After selecting a slicer for Store A - the visualization/s should show like below ; ie the selected Store + the KPI value, but shown in the ranked position relative to all other stores - while masking all other store detail 

 

KPI 1Kpi 2KPI 3
---
-Store A (30)-
Store A (300)--
---
---
--Store A (522)

 

Any help would be greatly appreciated (even if we can do it for 1 KPI)

 

Thank you

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

Hi @DerekRadue ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. Please note that this method is only suitable for selecting one store. If you select multiple stores, the result will be incorrect...

1. Create a table with the below formula

Rank = GENERATESERIES(1,DISTINCTCOUNT('Table'[Store]),1)

2. Create 3 measures to get KPI 1, KPI 2 and KPI 3 to display in different positions base on the ranking

NKPI1 = 
VAR _rankKPI1 =
    RANKX (
        ALL ( 'Table'[Store] ),
        CALCULATE ( SUM ( 'Table'[KPI 1] ) ),
        ,
        ASC,
        DENSE
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Rank'[Value] ) = _rankKPI1,
        CALCULATE (
            SUM ( 'Table'[KPI 1] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Store] IN ALLSELECTED ( 'Table'[Store] )
            )
        ),
        BLANK ()
    )

yingyinr_0-1621232613456.png

Best Regards

Community Support Team _ Rena
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-yiruan-msft
Community Support
Community Support

Hi @DerekRadue ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. Please note that this method is only suitable for selecting one store. If you select multiple stores, the result will be incorrect...

1. Create a table with the below formula

Rank = GENERATESERIES(1,DISTINCTCOUNT('Table'[Store]),1)

2. Create 3 measures to get KPI 1, KPI 2 and KPI 3 to display in different positions base on the ranking

NKPI1 = 
VAR _rankKPI1 =
    RANKX (
        ALL ( 'Table'[Store] ),
        CALCULATE ( SUM ( 'Table'[KPI 1] ) ),
        ,
        ASC,
        DENSE
    )
RETURN
    IF (
        SELECTEDVALUE ( 'Rank'[Value] ) = _rankKPI1,
        CALCULATE (
            SUM ( 'Table'[KPI 1] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Store] IN ALLSELECTED ( 'Table'[Store] )
            )
        ),
        BLANK ()
    )

yingyinr_0-1621232613456.png

Best Regards

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

Hi, Thank you that puts me on the track to get it done

 

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.

Top Solution Authors