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
SanketBhagwat
Solution Sage
Solution Sage

Show dynamic Top N and other values.

 
I need to create a dynamic measure taht will show Top N values accoridng to slicer selection and other values as OTHER.

I first created a dynamic Top N slicer according to Customer, but then I was not able to proceed further.

I found one article on the community,https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dynamic-dashboard-that-shows-TOP-N-and-OTHER-...

but that didn't gave me a satisfactory answer.

If someone knows any workaround then do please let me know.

I have attached screenshot of the data.

Screenshot (100).png

 

Regards,

Sanket Bhagwat

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

Hi, @SanketBhagwat 

According to your description, I can roughly understand your requirement, I think you can try these measures to achieve your requirement:

First you should create a table for the slicer, which you seems to have finished:

v-robertq-msft_0-1623380453964.png

 

  1. Create three measures like this:

 

SumRevenue = SUM('Table'[Revenue])
Rank =

RANKX(ALL('Table'),CALCULATE([SumRevenue]),,DESC,Dense)
SumRevenue1 =

var _topN=SELECTEDVALUE(Slicer[Top N])

return

IF([Rank]<=_topN,[SumRevenue],"OTHER")

 

  1. Then you can create a slicer and a table chart to place them like this:

v-robertq-msft_1-1623380453972.png

v-robertq-msft_2-1623380453976.png

 

And you can get what you want.

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

3 REPLIES 3
Anonymous
Not applicable

Hi everyone, I'm new to power bi. Please help me separate the data from the virtual table into the corresponding tables as follows:

 

nghia69371_0-1623377922390.pngnghia69371_1-1623380055937.png

I want to separate the data lines and from the arrow to fill the data before the arrow in the columns in the respective tables, please help me, thanks a lot

 

v-robertq-msft
Community Support
Community Support

Hi, @SanketBhagwat 

According to your description, I can roughly understand your requirement, I think you can try these measures to achieve your requirement:

First you should create a table for the slicer, which you seems to have finished:

v-robertq-msft_0-1623380453964.png

 

  1. Create three measures like this:

 

SumRevenue = SUM('Table'[Revenue])
Rank =

RANKX(ALL('Table'),CALCULATE([SumRevenue]),,DESC,Dense)
SumRevenue1 =

var _topN=SELECTEDVALUE(Slicer[Top N])

return

IF([Rank]<=_topN,[SumRevenue],"OTHER")

 

  1. Then you can create a slicer and a table chart to place them like this:

v-robertq-msft_1-1623380453972.png

v-robertq-msft_2-1623380453976.png

 

And you can get what you want.

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

Thanks @v-robertq-msft  for the reply.

Yes, I think that can be one of the ways to achieve the same.

Although visually it doesn't look proper, but it definitely serves the purpose. 

 

Regards,

Sanket Bhagwat

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.