Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nhch
Frequent Visitor

Visual with constant measure bypass filters

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:

nhch_1-1712316049467.png

table2:

nhch_2-1712316078562.png

measure:

measure1 = 1


and the following relationship:

nhch_3-1712316122165.png

 

in the visual without measure i get the expected result while in the visual with measure i get all the data:nhch_0-1712315882430.png

I'm missing out something in DAX?

Thank you in advance! 
Thomas

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

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())

vtangjiemsft_0-1712569289336.png

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. 

View solution in original post

5 REPLIES 5
v-tangjie-msft
Community Support
Community Support

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())

vtangjiemsft_0-1712569289336.png

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. 

MNedix
Solution Supplier
Solution Supplier

Strange, it works for me (see attached). M1b = 1bypass_1.jpg

nhch
Frequent Visitor

In the table you are taking the T2Col1 field, if you do the same with T1Col1 you get all the results 

MNedix
Solution Supplier
Solution Supplier

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.

nhch
Frequent Visitor

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)

nhch_1-1712319242263.png


Thank you again

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.