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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
t_guet01
Helper I
Helper I

How do I create a measure ignoring filters inside a table and keep selected filters outside?

Hey guys,

 

I am currently facing an issue that I use measures in a table, which should only consider certain filters but not all filters applied. I tried many combinations of all, allexcept, allselected, and removefilters, but I am not getting there.

 

The target table should look as follows:

 

CustomerProductSales# Storages
AP12003
AP24003
BP13002
............

 

My target:

- I would like the measure "Sales" to respect the filtering within the table, so "Customer" and "Product" dimension. I would also like the measure to respect the filters "Year" and "Product" from outside, but no others filters (e.g. "Sales Region")

- I would like the measure "Storages" to respect only filtering by "Customer" within the table (but not "Product") and only "Year" and "Products" from outside the table (but not "Sales Region" etc.).

 

Current measures:

- Sales = SUM ( 'Orders'[Net] )

- Storages = Countdistinct ( 'Orders'[StorageID] )

 

Filter pane: 

- Year = 2022

- Products: P1 and P2

- Sales region: EMEA

- ... (more filters)

 

My input data look as follows:

 

Orders:

CustomerIDProductIDDateNetStorageID
C98714785201.01.202210S123
C65436925802.01.202215S456

 

Customer data:

CustomerIDCustomerNameSales Region...
C987AEMEA...
C654BLATAM...

 

Product data:

ProductIDProductName...
147852P1...
369258P2...

 

How do I need to edit the measures to have the aimed effect?


Thanks and best

T

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

Hi @t_guet01,

I'd like to suggest you take a look at the following blog about all functions that can be used to ignore the specific filter effects.

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

In addition, you can also consider breaking or turning off the 'active' relationships and use TREATAS or USERELATIONSHIP functions to calculate with specific filter effects in your expression.

Power BI USERELATIONSHIP vs TREATAS - Enterprise DNA

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @t_guet01,

I'd like to suggest you take a look at the following blog about all functions that can be used to ignore the specific filter effects.

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

In addition, you can also consider breaking or turning off the 'active' relationships and use TREATAS or USERELATIONSHIP functions to calculate with specific filter effects in your expression.

Power BI USERELATIONSHIP vs TREATAS - Enterprise DNA

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors