Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi,
If I pass a filter to a report in a URL it becomes a page filter. Is there any way to retrieve that filter condition when there are no rows matching the condition? As there are no rows I can't use SELECTEDVALUE() and I can't see anything else I could use. I understand that this would be complex as the condition could be equals, not equals, etc.
This isn't my example, but a trivial example might be a web site where someone enters their search term "tomato" which is passed as a filter to the URL and the report would not contain any tomato data so could show a message "sorry, tomato not found". In my case I can't ensure that the value passed is always present in the data.
Many thanks.
Solved! Go to Solution.
I don't think that this will be possible because of the way filters work. Even if you specify the condition as a boolean, filters are always tables of values which already exist in the data. For example, if you specify 'Table'[Column] < 5 as a condition, that might be translated into a list like { 0, 1, 2, 3, 4 }. But if you don't have any entries where the value is 3 then the list would be { 0, 1, 2, 4 }.
Given that, if you try to use as a filter a value which doesn't exist in your data then Power BI will basically just throw that value away.
Having said that, you might be able to detect the fact that a missing value was passed in, even if you can't detect what the value was. You could create a measure like
Missing value used as filter =
IF (
ISFILTERED ( 'Table'[Column] ) && ISEMPTY ( FILTERS ( 'Table'[Column] ) ),
1
)
This checks that there is a filter applied to the column, but the values or condition applied don't match any of the existing data.
I don't think that this will be possible because of the way filters work. Even if you specify the condition as a boolean, filters are always tables of values which already exist in the data. For example, if you specify 'Table'[Column] < 5 as a condition, that might be translated into a list like { 0, 1, 2, 3, 4 }. But if you don't have any entries where the value is 3 then the list would be { 0, 1, 2, 4 }.
Given that, if you try to use as a filter a value which doesn't exist in your data then Power BI will basically just throw that value away.
Having said that, you might be able to detect the fact that a missing value was passed in, even if you can't detect what the value was. You could create a measure like
Missing value used as filter =
IF (
ISFILTERED ( 'Table'[Column] ) && ISEMPTY ( FILTERS ( 'Table'[Column] ) ),
1
)
This checks that there is a filter applied to the column, but the values or condition applied don't match any of the existing data.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
12 | |
10 | |
9 | |
9 |
User | Count |
---|---|
17 | |
14 | |
12 | |
9 | |
9 |