Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
How can I see if a value is in the return of function FILTERS()? e.g., I have a filter Brand(A, B, C), and I want to know if Brand A is selected to filter the data.
Or there are some other functions I can use to do it if Filters() is not a good choice,
Thanks!
Solved! Go to Solution.
Hi @Anonymous,
Try measure instead of using calculated column.
FILTERS() in measure will return dynamic result, however it will always return the entire column values in a calculated column.
Thanks,
Xi Jin.
Hi @Anonymous,
Yes. Brand A is selected to filter the data.
FILTERS() function returns the values that are directly applied as filters to columnName. Please refer to following simple sample:
As you can see the Source Table contains 9 rows as A to I. And the Filters table only contains 3 rows A to C. Then create a measure for Source Table with expression like:
Count Rows = COUNTROWS(FILTERS('Filters'[User]))The result will show as 3 since the Source Table has been filtered by Filters table.
Thanks,
Xi Jin.
Thanks...and here's what I'd tried and got confused:
when I select the brand(s)(A,B, or C) from the Filter Brand, I always can see row# = CounterRows(Filters(Product[Brand]) changes with what I selected, e.g, if I select A, row# = 1; if I select A and B, Row# = 2; if I select A, B and C, row# =3.
at the same time, I created column Flag = if(ContainsRow(Filters(Product[Brand],"A"), "T","F") to test if A is selected as filter value (I tried B and C also). No matter A is seleted or not, always the Flag = "T", which means Filters(Product[Brand]) always contains all A, B and C as its values, but CounterRows() tells me another story that Filters() only contains what I select.
what I want to achieve is checking if "A" is selected and applied as filter on the dashboard. I would like to know if containsRow() or IN functions can work with FILTERS() to get things done. Or any other ADX function can do it.
Thanks!
Hi @Anonymous,
Try measure instead of using calculated column.
FILTERS() in measure will return dynamic result, however it will always return the entire column values in a calculated column.
Thanks,
Xi Jin.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 35 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |