In Power BI, I am trying to create a table using a DAX expression. In my report, the VALUES function does not behave as I expect it to. Instead of returning filtered values it returns all values.
Microsofts reference information says:
When you use the VALUES function in a context that has been filtered, the unique values returned by VALUES are affected by the filter.
Am I misunderstanding the above information or could something in my report cause a different behavior?
Example: Table "Users" has two columns, "Name" and "Car". Table "Brands" has one column, "Brand". There is a one to many relationship from Brands to Users. I use this formula to create a new table:
SelectedNames = VALUES(Users)
I then make three visuals:
- A Table showing Users.
- A Slicer showing Brand[Brand].
- A Table showing SelectedNames.
I expect the third visual to show the same (distinct) names displayed in the first visual. It does not. Instead it always shows the full list of names regardless of what is selected in the slicer.
A screenshot of my report:
In Power BI, I am trying to create a table using a DAX expression. In my report, the VALUES function does not behave as I expect it to. Instead of returning filtered values it returns all values.
Microsofts reference information says:
When you use the VALUES function in a context that has been filtered, the unique values returned by VALUES are affected by the filter.
Am I misunderstanding the above information or could something in my report cause a different behavior?
Example: Table "Users" has two columns, "Name" and "Car". Table "Brands" has one column, "Brand". There is a one to many relationship from Brands to Users. I use this formula to create a new table:
SelectedNames = VALUES(Users)
I then make three visuals:
- A Table showing Users.
- A Slicer showing Brand[Brand].
- A Table showing SelectedNames.
I expect the third visual to show the same (distinct) names displayed in the first visual. It does not. Instead it always shows the full list of names regardless of what is selected in the slicer.
A screenshot of my report:
Share Improve this question asked Mar 19 at 12:45 FredrikFredrik 6701 gold badge7 silver badges22 bronze badges1 Answer
Reset to default 0When creating a table object in DAX, the code is evaluated and run each time there is a change to the data model. Filters interactions do not impact the table, and therefore you should use a measure instead of a table.
From your example, you should activate the one to many relationship between users and brands, and that should filter the list of users you are looking for.