Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 count if more than three are selected.
However I can't work out how to make it always show the first 3 no matter how many are selected.
Below is where I've got to, the _Top3 variable isn't working. The other two are fine.
Thank you!
VAR _Count = COUNTROWS( VALUES ('Table'[SlicerColum]) )
VAR _Concat = CONCATENATEX( VALUES('Table'[SlicerColumn]), 'Table1'[SlicerColumn], ", ")
VAR _Top3 = TOPN( 3, 'Table1', _Concat, ASC)
RETURN IF ( _Count > 3,
_Top3 & " + " & (_Count - 3) & " more",
_Concat )
Solved! Go to Solution.
@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 , Try a measure like
VAR _Count = COUNTROWS( VALUES ('Table'[SlicerColum]) )
VAR _Top3 = CONCATENATEX( TOPN( 3, allseleccted('Table'[SlicerColumn]), _Count, ASC), [SlicerColumn] )
RETURN _Top3
Hi, 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.
@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
Thank you, yes this works!
I'm replying here jut to follow on all answers. Thank you
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
16 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |