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
oscarmqz
Advocate II
Advocate II

Filtered measure that ignores a slice

Hi I have a matrix with a single measure which is a delta

 

Pseudo formula is: CurrentValues - ValuesSelected (From a cycle slicer)

 

For the CurrentValues part I want to ignore the cycle slicer with the below formula

 

mSavingsDelta = CALCULATE(SUM('CIP-ReportingDataNEW'[Savings (K$)]),'CIP-ReportingDataNEW'[Source]="Current",ALL('CIP-ReportingDataNEW'[Cycle]))
 
This formula works just fine inside a card even selecting something in the cycle slicer, but it doesn't work on a matrix...
 
Capture.JPGCapture2.JPG
I can't edit the interaction with the slicer because I still need the second part of the delta formula to react to the slicer which will simply by - sum ('CIP-ReportingDataNEW'[Savings (K$)])
 
Any help is appreciated!
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @oscarmqz ,

 

First create an unrelated Cycle table as slicer.

Then create a measure like this :

measure =
VAR mSavingsDelta =
    CALCULATE (
        SUM ( 'CIP-ReportingDataNEW'[Savings (K$)] ),
        'CIP-ReportingDataNEW'[Source] = "Current"
    )
VAR selectedvalue_ =
    CALCULATE (
        SUM ( 'CIP-ReportingDataNEW'[Savings (K$)] ),
        FILTER (
            'CIP-ReportingDataNEW',
            'CIP-ReportingDataNEW'[Cycle] = SELECTEDVALUE ( 'TABLE'[Cycle] )
        )
    )
RETURN
    mSavingsDelta - selectedvalue_

If the problem persists,could you share the sample pbix or sample data?

Please mask any sensitive data before uploading

 

Best Regards,
Liang
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

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @oscarmqz ,

 

First create an unrelated Cycle table as slicer.

Then create a measure like this :

measure =
VAR mSavingsDelta =
    CALCULATE (
        SUM ( 'CIP-ReportingDataNEW'[Savings (K$)] ),
        'CIP-ReportingDataNEW'[Source] = "Current"
    )
VAR selectedvalue_ =
    CALCULATE (
        SUM ( 'CIP-ReportingDataNEW'[Savings (K$)] ),
        FILTER (
            'CIP-ReportingDataNEW',
            'CIP-ReportingDataNEW'[Cycle] = SELECTEDVALUE ( 'TABLE'[Cycle] )
        )
    )
RETURN
    mSavingsDelta - selectedvalue_

If the problem persists,could you share the sample pbix or sample data?

Please mask any sensitive data before uploading

 

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

Thanks @V-lianl-msft this is what I ended up figuring out too. Appreciate your help guys!

pranit828
Community Champion
Community Champion

HI @oscarmqz 

try

mSavingsDelta = CALCULATE(SUM('CIP-ReportingDataNEW'[Savings (K$)]),'CIP-ReportingDataNEW'[Source]="Current",ALLEXCEPT('CIP-ReportingDataNEW'[Cycle]))





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Already tried that but using allexcept ignores all the attributes in the matrix showing the grand total for "current" in all the cells

 

Capture3.JPG

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.