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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
PhiBu
Helper I
Helper I

Measure should take into account 2 of 3 report filters

Hello all,

I have the following problem. I am trying to create a measure that takes into account 2 of my report filters (date and category) and not a third one (product). The goal is to calculate an average value.

 

I have already tried different solutions by combinations with FILTER, ALL, ALLEXCEPT, KEEPFILTER, SELECTEDVALUE, but unfortunately I haven't found a solution yet. Do you have any ideas?

 

Best regards, Philip!

 

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

HI @PhiBu,

I think you can try to write a measure expression to use 'OR' logic to link two filters and apply it to raw table records(you can use the 'all' function to ignore original filter effects at first). 

Measure =
VAR _filter1 =
    VALUES ( Table1[Column1] )
VAR _fitler2 =
    VALUES ( Table2[Column2] )
RETURN
    CALCULATE (
        SUM ( Fact[Amount] ),
        FILTER ( ALL ( Fact ), [column1] IN _filter1 || [column2] IN _filter2 )
    )

Then you can use this on visuals to enable the filter effects.

Notice: for custom filter effects, you need to use unconnected table fields as the filter source.

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

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @PhiBu,

I think you can try to write a measure expression to use 'OR' logic to link two filters and apply it to raw table records(you can use the 'all' function to ignore original filter effects at first). 

Measure =
VAR _filter1 =
    VALUES ( Table1[Column1] )
VAR _fitler2 =
    VALUES ( Table2[Column2] )
RETURN
    CALCULATE (
        SUM ( Fact[Amount] ),
        FILTER ( ALL ( Fact ), [column1] IN _filter1 || [column2] IN _filter2 )
    )

Then you can use this on visuals to enable the filter effects.

Notice: for custom filter effects, you need to use unconnected table fields as the filter source.

Regards,

Xiaoxin Sheng

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

Hi, 

Try using REMOVEFILTERS function.

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

@Jihwan_Kim thank you for your idea. 

Unfortunately, I haven't found a solution yet or don't know how to use the RemoveFilters function correctly. I have therefore created an example file. But I am not able to attache the file. Therefor I have the following screenshots.

PhiBu_2-1618475323144.png

 

PhiBu_1-1618475162868.png


Could you take a look at it and give me a tip on how to create the measure? That would be great.

Best regards, 
Philip

sayaliredij
Super User
Super User

Could you try the following measure and check if works?

 

NewMeasure = CALCULATE ( measure, ALL(Product))

 

Regards,

Sayali

 

If this post helps, then please consider Accept it as the solution to help others find it more quickly.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@sayaliredij Thanks for your reply. But I think the ALL function is not the function I need. Maybe in addition to another function.  I described the measure I want to create in more detail above. If you still want to support me :). 

Best regards, Philip

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.