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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
madamadakun
Frequent Visitor

Creating a Measure to remove effects of a slicer

Hi all,

 

I have been stuck at this for hours and wonder if I could get some help. Is there a way to get a value based on "unfilter" a slicer? Quick example is this.

 

ColourTypeValue
BlueCars1
BlueBlack2
YellowBlack3
YellowCars4
GreenTrucks5
GreenTrucks6

 

Let's say I have a slicer, "Colour", and "blue" is selected. I have a Matrix table with "type", and "value". Based on the slicer, only blue shows.  Can I create a measure for this table that show's the value of yellow as well? What i'm trying to do is create a value, unfilter and ignore the effects of the slicer, then select colour as yellow.

 

I heard calculate works:

YellowOnlyValue = CALCULATE(sum(Table1[Value]),filter(Table1,Table1[Value]="Yellow"))

 

Any help is appreciated.

 

The desire output is as follows.

 

TypeSlicer ValueYellowOnly Value
Cars13
Matrix24
1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @madamadakun,

 

Based on my test, you should be able to use the formula below to create a new measure to calculate the Yellow Only Value in your scenario. Smiley Happy

Yellow Only Value = 
VAR currentType =
    FIRSTNONBLANK ( Table1[Type], 1 )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        FILTER (
            ALL ( Table1 ),
            Table1[Colour] = "Yellow"
                && Table1[Type] <> currentType
        )
    )

r3.PNG

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Employee
Employee

Hi @madamadakun,

 

Based on my test, you should be able to use the formula below to create a new measure to calculate the Yellow Only Value in your scenario. Smiley Happy

Yellow Only Value = 
VAR currentType =
    FIRSTNONBLANK ( Table1[Type], 1 )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        FILTER (
            ALL ( Table1 ),
            Table1[Colour] = "Yellow"
                && Table1[Type] <> currentType
        )
    )

r3.PNG

Regards

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.