I have 3 measures from which I only want to show the top 3 values and the bottom 3 values in the same column for the respective measure.
S-ratio = MAX(DataUnpivot[Solvabiliteits-ratio])
Debt/EBITDA = MAX(DataUnpivot[Debt/EBITDA-ratio])
DSCR = MAX(DataUnpivot[DSCR column])
Could you explain me whether to use TOPN or RANKX and if possible send me some code I could realise this.
Your help is much appreciated
Go to Solution.
To receive below result.
You can modify below DAX expression.
Rank Top and Bottom Three Sales by Brand =
VAR __grain =
VALUES ( 'Product'[Brand] ),
--Rank by Column
) -- replace [Sales] with your Measure
VAR __top =
RANKX ( __grain, [Sales],, DESC ) <= 3
VAR __bottom =
RANKX ( __grain, [Sales],, ASC ) <= 3
SWITCH ( TRUE (), __top, [Sales], __bottom, [Sales] )
View solution in original post
I tried your solution and it seems to work, great.
One question regarding the bottom 3 values:
The measure only shows the top 3 ranks (as expected) but only the 2 bottom ranks.
Any clue on how to show the 3 bottom ranks?
Hi @Luukvv93 Can you share your DAX Expression?ThanksMariusz
Check out the News & Announcements to learn more.
Congratulations, the new Super User Season 2 for 2021 has started!
Check out the new Power Platform Community Connections gallery!
Mark your calendars and join us for our next Power BI Dev Camp!