Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi!
I've followed the procedure outlined in this website https://radacad.com/search-in-power-bi-table-visual-using-a-slicer-for-contains-character-criteria which details how to slice a table based on whether entries contain particular text. However, I can't seem to make a measure for a card visual which could report the number of rows in the sliced table.
Unfortunately the data that I'm working with is a bit sensitive so I can't share my files, but from the example in the website above, what I would like to do is report, for example, the total number of customer names that contain the letter "a". Seems pretty simple but all of my attempts have failed.
Thanks!
Solved! Go to Solution.
@Anonymous So, that's just an example of a Complex Selector. The Complex Selector - Microsoft Power BI Community
To get this in a Card visualization, do this:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Selector",[Selector Measure])
RETURN
COUNTROWS(FILTER(__Table,[__Selector] > -1))
@Anonymous So, that's just an example of a Complex Selector. The Complex Selector - Microsoft Power BI Community
To get this in a Card visualization, do this:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Selector",[Selector Measure])
RETURN
COUNTROWS(FILTER(__Table,[__Selector] > -1))
Ah I see. This worked perfectly! Thanks so much @Greg_Deckler !
As a bonus - what if I'd like to slice by more than one complex selector? So in your example, say I wanted to slice by the number of weeks and if a state contained particular text (or some other sort of slice that isn't simply state name I suppose).
@Anonymous Probably something like:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Selector",[Selector Measure])
RETURN
COUNTROWS(FILTER(__Table,[__Selector] > -1) && [NoOfWeeks] = 12)
So if I understand this correctly @Greg_Deckler , in that instance the [NoOfWeeks] would be known to be 12. But what if I want this to be another user input, likely via a separate complex selector?
@Anonymous Or you could just use a VAR and set it equal SELECTEDVALUE to grab the selected item in the slicer
@Greg_Deckler You're 100% correct. I ended up with:
Measure =
VAR __Table = ADDCOLUMNS('Table',"__Selector1",[Selector1 Measure],"__Selector2",[Selector2 Measure])
RETURN
COUNTROWS(FILTER(__Table,[__Selector1] > -1 && [__Selector2] > -1))
Thanks so much for your help!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.