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
Anonymous
Not applicable

Top N with multiple drill down.

I have the following table:

 

   Name       Number Letter   Value

Carlos1A80
Carlos1B70
Carlos2A60
Carlos2B50
Henrique1A40
Henrique1B30
Henrique2A20
Henrique2B10
Macias1A10
Macias1B9
Macias2A8
Macias2B7

 

And the folowing matrix visual and slicer:image.png

 

 

To create the rank, i used this formua:

 

 

Rank = 
IF(
    ISFILTERED(Table1[Level Letter]);
    RANKX(ALLSELECTED(Table1[Level Letter]); CALCULATE(SUM(Table1[Value])); ; DESC; Dense);
    IF(
        ISFILTERED(Table1[Level Number]);
        RANKX(ALLSELECTED(Table1[Level Number]); CALCULATE(SUM(Table1[Value])); ; DESC; Dense);
        RANKX(ALLSELECTED(Table1[Level Name]); CALCULATE(SUM(Table1[Value])); ; DESC; Dense)
    )
)

 

 

And get the selected value of the top N slicer I am using this code:

 

SelectedValue = 
IF(
    HASONEVALUE('TopN'[Show N]);
    SELECTEDVALUE('TopN'[ID]);
    -1
)

 

Now I need a way to show only the Top N values and subvalues. For example:

 

 

Show Top 1:image.png

 

 

 

Show Top 2:

image.png

 

But I can not find a way to do so. 

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at the following post.

http://community.powerbi.com/t5/Desktop/How-to-add-visual-filter-if-the-criteria-is-measure/m-p/394040#M179742

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

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.