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 for subcategory

Hello,

 

I have table with product,reason and values.

For each product i need to show top 5 values(measure named #m_cases). So i have written the formula for rank and added that in filter. The values are showing right but the total values are showing for only top 5 . I need to show top5 values for each product with right values and total should for all reasons. 

     I have added the below measure, it showing the right totals but values for each reason is showing same values!

 

ALLSELECTED = CALCULATE([#m_Cases],ALL('Cases'[Reason]))

 

  • Kindly help. Thanks in Advance.

 

 

1 ACCEPTED SOLUTION
Payeras_BI
Super User
Super User

Hi @Anonymous ,

 

I think I understood it now.

 

Your measure =
IF (
    ISINSCOPE ( 'Cases'[Reason] ) = TRUE (),
    [#m_Cases],
    CALCULATE ( [#m_Cases], ALL ( 'Cases'[Reason] ) )
)

 

Please let me know the result.

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

5 REPLIES 5
Payeras_BI
Super User
Super User

Hi @Anonymous ,

 

I think I understood it now.

 

Your measure =
IF (
    ISINSCOPE ( 'Cases'[Reason] ) = TRUE (),
    [#m_Cases],
    CALCULATE ( [#m_Cases], ALL ( 'Cases'[Reason] ) )
)

 

Please let me know the result.

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Payeras_BI
Super User
Super User

Hi @Anonymous ,

 

Try substituting ALL by VALUES.

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Anonymous
Not applicable

Not working!

Hi @Anonymous ,

 

Help me to understand your expected output. From your original screenshot, which values are correct and which are incorrect?

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Anonymous
Not applicable

Here is the Matrix table where i removed the top 5 filter.

 

 Here, For Avalara account i need the top 5 subcategory (filed name - Reason) by the value (#m_cases). I need to show the top 5 values but the total should exclude the top 5 and show for all reason. I.e 16384.

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