Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I'm facing a peculiar issue, if i add a measurement to a visual it shows more data, bypassing the filters.
Here's the simplest setup where i can recreate the issue:
Given two tables and one measurment:
table1:
table2:
measure:
and the following relationship:
in the visual without measure i get the expected result while in the visual with measure i get all the data:
I'm missing out something in DAX?
Thank you in advance!
Thomas
Solved! Go to Solution.
Hi @nhch ,
Based on your description, the measure value you created is a constant value that does not depend on any tables or columns in the model. This feature of the measure may be why it seems to bypass the filters applied to the visual objects.
In Power BI, the measure calculates results based on the current filter context. However, because the measure is constant and not associated with any specific data in the model, it does not react to filter changes as expected. It only returns the same value regardless of the filter applied, which may give the impression that it bypasses the filter.
When applying a filter to a visual object, it changes the filter context and recalculates the measure value based on this new context. However, constant measures like this one are not affected. If you want the measure to respond to the filter, consider modifying it to include references to table columns or other measures that change with the filter context. In this way, the output of the measure value can change dynamically depending on the applied filter.
Measure 2 = IF(MAX('Table1'[T1col1]) IN VALUES('Table2'[T2col1]),1,BLANK())
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @nhch ,
Based on your description, the measure value you created is a constant value that does not depend on any tables or columns in the model. This feature of the measure may be why it seems to bypass the filters applied to the visual objects.
In Power BI, the measure calculates results based on the current filter context. However, because the measure is constant and not associated with any specific data in the model, it does not react to filter changes as expected. It only returns the same value regardless of the filter applied, which may give the impression that it bypasses the filter.
When applying a filter to a visual object, it changes the filter context and recalculates the measure value based on this new context. However, constant measures like this one are not affected. If you want the measure to respond to the filter, consider modifying it to include references to table columns or other measures that change with the filter context. In this way, the output of the measure value can change dynamically depending on the applied filter.
Measure 2 = IF(MAX('Table1'[T1col1]) IN VALUES('Table2'[T2col1]),1,BLANK())
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Strange, it works for me (see attached). M1b = 1
In the table you are taking the T2Col1 field, if you do the same with T1Col1 you get all the results
Hi,
I think it has something to do with how measures are interpreted in the context of the tables and relationships. If you create another measure, e.g: Measure2 = sum('Table 1'[T1Col1]) - in Table 1 then the filtering will work. Also, if you create the same Measure1 but in Table2 the the filtering will also work.
Thank you for replying,
If i do the measure 2 the filtering is ok but it has not the result i was expecting.
But if i create the same Measure1 in Table2 it wont work. in this updated example you can see the new measure (measure1T2) having the same behaviour as the old one (now renamed measure1T1)
Thank you again
User | Count |
---|---|
98 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |