Forum Discussion
Totoro
3 years agoNew Member
Top N filter plus one specific item
Hi The data and desired outcome (top 3 in rank plus colour=pink if it is not in tope 3) are as below: The measure Rank ...
- 3 years ago
tamerj1
Community Champion
3 years agoHi Totoro
Please refer to attached sample file with the solution
Top 3 Stock =
VAR T1 =
CALCULATETABLE (
VALUES ( Data[Colour] ),
ALLEXCEPT ( Data, Data[Category] )
)
VAR T2 = TOPN ( 3, T1, [Total Stock] )
VAR T3 = UNION ( T2, { "Pink" } )
VAR T4 = FILTER ( Data, Data[Colour] IN T3 )
RETURN
SUMX ( T4, [Total Stock] )
- Totoro3 years agoNew Member
Many thanks tamerj1 for the code and pbix file! Should have posted the question earlier I have been struggling with it for weeks.