Forum Discussion

Karma777's avatar
Karma777
Frequent Visitor
3 years ago
Solved

Using Remove Filter function in measure not working

Hi,

I have a simple visual like below which is a simple bar chart of "Demand" vs "Date-time"

The Demand is a measure calculated as : 

Demand Rap = (CALCULATE(sum(Facts[Assignment Committed Work])+sum(Facts[Assignment Proposed Work]), filter(Projects, Projects[Division Priority Project Name] <> BLANK())))/168

There are many page level filters on the report as below. 


Now my requirement is, I would like to modify my measure so that selection of "Resource Is Active" filter doesn't impact the calculation ( since there are other visuals on the page which need this filter ). I tried modifying the measure using 'REMOVEFILTER' function but its not working as expected.

Demand Rap exc resoureceIsActive = (CALCULATE(sum(Facts[Assignment Committed Work])+sum(Facts[Assignment Proposed Work]),REMOVEFILTERS(Resources[ResourceIsActive]), filter(Projects, Projects[Division Priority Project Name] <> BLANK())))/168


Please help me in understanding what am I missing here and what should be the correct way to do this.
Thansk you!

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Karma777 ,

     

    Here I create a sample file to have a test.

    Facts:

    Projects:

    Project:

    Relationship:

    I suggest you to create [Demand Rap exc resoureceIsActive] measure based on [Demand Rap] measure.

    Demand Rap exc resoureceIsActive = 
    CALCULATE([Demand Rap],REMOVEFILTERS(Resources[ResourceIsActive]))

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Karma777 ,

     

    Here I create a sample file to have a test.

    Facts:

    Projects:

    Project:

    Relationship:

    I suggest you to create [Demand Rap exc resoureceIsActive] measure based on [Demand Rap] measure.

    Demand Rap exc resoureceIsActive = 
    CALCULATE([Demand Rap],REMOVEFILTERS(Resources[ResourceIsActive]))

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

    • Karma777's avatar
      Karma777
      Frequent Visitor

      Hi Anonymous , Thank you for taking your time to answer. I tried doing this but it still is giving the same result.
      Also could you please help me understand how is the data being calculated in the example you showed. Since the report is filtered to resourcetype in (2,20), project p3 value should be ignored. Similarly p4 should be ignored as Division Priority Project Name filed is empty. So I assume the final chart should show only 2 projects- p1 & p2 with the values 3 & 5. Could you please explain how we are getting 5 & 8 in the chart?