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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

create a measure that keeps filters

Hi,

Take the following schema as an example:

 

image.png

 

Let's say I build the following report where i filter the data table by the week table:

 

image.png

if i create a measure (let's say Measure=1), how can i build it so that it keeps existing filters (unlike below example)?

 

image.png

 

please keep in mind that this is just an example: my real-life dashboard has many more tables and filters involved.

Thanks

 

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @Anonymous,

The Product Team have replied me that the problem is by design.

A filter is applied in two cases: (1) The filter applies to any columns from the same table. (2) The filter applies to all measures and afterwards the measure values will filter the columns by removing rows where measure values are all BLANKs. In this case, the filter is on the 'week' table, therefore doesn't apply columns from the 'data' table. On the other hand, the measure expression ignores all filters and always returns a non-BLANK value, therefore the indirect effect of preserving rows only with non-BLANK measure values will preserve all rows. The net effect is that the slicer has no impact on the table visual. When a measure is not added to a table visual, Power BI injects a hidden measure that's similar to CountRows('data') which is filtered by the slicer and then indirectly filter the result.

Hope it could help you.

 

Regards,

Daniel He

Community Support Team _ Daniel He
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

2 REPLIES 2
v-danhe-msft
Employee
Employee

Hi @Anonymous,

The Product Team have replied me that the problem is by design.

A filter is applied in two cases: (1) The filter applies to any columns from the same table. (2) The filter applies to all measures and afterwards the measure values will filter the columns by removing rows where measure values are all BLANKs. In this case, the filter is on the 'week' table, therefore doesn't apply columns from the 'data' table. On the other hand, the measure expression ignores all filters and always returns a non-BLANK value, therefore the indirect effect of preserving rows only with non-BLANK measure values will preserve all rows. The net effect is that the slicer has no impact on the table visual. When a measure is not added to a table visual, Power BI injects a hidden measure that's similar to CountRows('data') which is filtered by the slicer and then indirectly filter the result.

Hope it could help you.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-danhe-msft
Employee
Employee

Hi @Anonymous,

The problem has been reported internally, I will update here once I get any information. 

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.