Forum Discussion
Sliced table row total
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!
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))
6 Replies
- Greg_DecklerCommunity Champion
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))- AnonymousNot applicable
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).
- Greg_DecklerCommunity Champion
Anonymous Probably something like:
Measure = VAR __Table = ADDCOLUMNS('Table',"__Selector",[Selector Measure]) RETURN COUNTROWS(FILTER(__Table,[__Selector] > -1) && [NoOfWeeks] = 12)