Forum Discussion
Ry5
Helper I
4 years agoShow First 3 selected values then a count
Hi, I have a slicer and am using a card on which I want to show the first 3 selections, then a count of how many additional selections have been made. I can make it show the first three OR a co...
- 4 years ago
Ry5 try this:
Top 3 Measure = -- Rename to ItemList & [Item] to simplify code VAR ItemList = SELECTCOLUMNS ( VALUES ( 'Table'[SlicerColumn] ), "Item", 'Table'[SlicerColumn] ) VAR _Count = COUNTROWS ( ItemList ) VAR _Top3 = TOPN ( 3, ItemList, [Item], ASC ) VAR _Concat = CONCATENATEX ( _Top3, [Item], ", ", [Item] ) RETURN _Concat & IF ( _Count > 3, " + " & ( _Count - 3 ) & " more" )Regards, Owen
Ry5
Helper I
4 years agoHi, Thank you for the reply but this didn't work. It returns a full list of everything in the slicer. Even if I only select one option.
OwenAuger
Super User
4 years agoRy5 try this:
Top 3 Measure =
-- Rename to ItemList & [Item] to simplify code
VAR ItemList =
SELECTCOLUMNS (
VALUES ( 'Table'[SlicerColumn] ),
"Item", 'Table'[SlicerColumn]
)
VAR _Count =
COUNTROWS ( ItemList )
VAR _Top3 =
TOPN ( 3, ItemList, [Item], ASC )
VAR _Concat =
CONCATENATEX ( _Top3, [Item], ", ", [Item] )
RETURN
_Concat
& IF ( _Count > 3, " + " & ( _Count - 3 ) & " more" )
Regards, Owen
- Ry54 years ago
Helper I
Thank you, yes this works!