Forum Discussion
J_Mug
6 years agoHelper I
Limit items in visual (TOPN?)
Hi, I want to know if it's possible to limit the number of items in a visual to 10 or so, giving Power BI some conditions. For example, I have 300 results por stores, for each store I know th...
v-gizhi-msft
6 years agoCommunity Support
Hi,
I create a sample to show first 5 stores for Top and Buttom defined in your post.
Please take following steps:
1)Create a slicer table by Enter Data:
2) Try this measure:
Measure =
VAR _buttom =
IF (
MAX ( 'Table'[NPS] ) < 50
&& MAX ( 'Table'[Error] ) < 0.05,
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[NPS] < 50 && 'Table'[Error] < 0.05 ),
CALCULATE ( SUM ( 'Table'[NPS] ) ),
,
ASC,
DENSE
)
)
VAR _top =
IF (
MAX ( 'Table'[NPS] ) > 60
&& MAX ( 'Table'[Error] ) < 0.05,
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[NPS] > 60 && 'Table'[Error] < 0.05 ),
CALCULATE ( SUM ( 'Table'[NPS] ) ),
,
ASC,
DENSE
)
)
RETURN
SWITCH (
SELECTEDVALUE ( SlicerTable[Slicer] ),
"Top", IF ( _top <= 5 && _top <> BLANK (), 1 ),
"Buttom", IF ( _buttom <= 5 && _buttom <> BLANK (), 1 )
)
3)When select one value in slicer, it shows:
See my attached pbix file.
Best Regards,
Giotto