Forum Discussion
Top N in table with multiple columns
- Anonymous3 years ago
Hi manojk_pbi ,
As above I add a rank in my calculation, so if you want to show TOP N in another way, we need to add some condtions in my code to create new rank.
You can show me a screenshot with the result you want as Product Top2 and Top3, I will try to find the condtion to help you solve your issue.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi manojk_pbi ,
I suggest you to create a number range slicer with what is parameter function.
Then create a DimProductType table for slicer.
Relationship:
Measure:
Rank =
VAR _SELECTTOPN =
SELECTEDVALUE ( 'Top N'[Top N] )
VAR _RANK =
IF (
ISFILTERED ( DimProduct[ProductType] ),
RANKX (
ALLEXCEPT ( 'Table', 'Table'[ProductType] ),
CALCULATE ( SUM ( 'Table'[Exposure] ) )
),
RANKX ( ALL ( 'Table' ), CALCULATE ( SUM ( 'Table'[Exposure] ) ),, DESC, DENSE )
)
RETURN
IF ( ISFILTERED ( 'Top N'[Top N] ), IF ( _RANK <= _SELECTTOPN, 1, 0 ), 1 )
Add this measure into visual level filter and set it to show items when value = 1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.