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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

measure value should not change based on the slicer selected

Hi,

Pleas help me

Below is my dataset.

I am looking to create 2 measures 

Measure 1 = Calculte(Sum(Sales),filter(Sales Type)= "SMD" ---  This will work with all the slicers from the table

Measure 2 = Calculte(Sum(Sales),filter(Sales Type)= "SMD", filter(Maker) ="Pepsi"-- This works as above but slicer should not work

for column Maker.

Slicers (Column Names ) : Slicer_1 = Maker

                                          Slicer_2 = Category

Measure 1 will change as per the slicers selected

Measure 2 should not change when slicer_1 is selected and will change when Slicer_2 is selected.

DateMakerCategorySales TypeSales
01/01/2022PepsiSDCVS12
01/01/2022MZSDSMD17
01/01/2022CZSDCVS17
01/01/2022CCSDSMD12
01/02/2022PepsiSDCVS19
01/02/2022MZSDSMD13
01/02/2022CZSDCVS14
01/02/2022CCSDSMD20
01/03/2022PepsiSDCVS16
01/03/2022MZSDSMD11
01/03/2022CZSDCVS14
01/03/2022CCSDSMD19
01/04/2022PepsiSDCVS19
01/04/2022PepsiSDSMD10
01/04/2022MZSDCVS17
01/04/2022CZSDSMD12
01/05/2022CCSDCVS11
01/05/2022PepsiSDSMD18
01/05/2022MZSDCVS19
01/05/2022CZSDSMD19
01/01/2022CCPPCVS10
01/01/2022PepsiPPSMD14
01/01/2022MZPPCVS15
01/01/2022CZPPSMD16
01/02/2022CCPPCVS19
01/02/2022PepsiPPSMD15
01/02/2022MZPPCVS14
01/02/2022CZPPSMD19
01/03/2022CCPPCVS20
01/03/2022PepsiPPSMD18
01/03/2022MZPPCVS19
01/03/2022CZPPSMD13
01/04/2022CCPPCVS20
01/04/2022PepsiPPSMD11
01/04/2022MZPPCVS11
01/04/2022CZPPSMD16
01/05/2022CCPPCVS12
01/05/2022PepsiPPSMD10
01/05/2022MZPPCVS10
01/05/2022CZPPSMD13
6 REPLIES 6
TonyZhou1980
Resolver I
Resolver I

Try to apply below for Measure 2 and see it meets your requirement,

 

Measure 2 =
    CALCULATE(
        sum(Table[Sales]),
        KEEPFILTERS(Table[Sales Type]="SMD"),
        KEEPFILTERS(Table[Maker]="Pepsi")
    )
Mikelytics
Resident Rockstar
Resident Rockstar

Hi  @Anonymous 

 

Can you please try the following:

 

For "Table" please put in your table name.

 

Measure 2 = 
CALCULATE(
   SUM(Table[Sales]),
   FILTER(Table,[Sales Type]= "SMD"), 
   Table[Maker]="Pepsi"
)

 

Best regards

Michael

-----------------------------------------------------

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

Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Arul
Super User
Super User

@Anonymous ,

you need to use REMOVEFILERS in the measure and bring the field [Maker] which you are using in the slicer.
I belive you have to change the existing syntax of the measure slightly to make it work properly. Refer the modified code and make the changes based on your need and let me know if you need any help.

Measure 2 = CALCULATE((Sum(Sales),filter(<table>,Sales Type)= "SMD", filter(<table>,Maker) ="Pepsi",REMOVEFILTERS(<table>[Maker]))

 Thanks, 





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

Proud to be a Super User!


LinkedIn


Anonymous
Not applicable

@Arul Thanks for your replay,

I am getting the below error.

 

Raks_0-1670848952241.png

 

@Anonymous ,

try the excat formula attached below,

Sales for SMD =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    SalesType = "SMD",
    Maker = "Pepsi",
    REMOVEFILTERS ( 'Table'[Maker] )
)

Thanks,





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

Proud to be a Super User!


LinkedIn


Anonymous
Not applicable

@Arul ,

Thanks again !

But this is not working as expected 

image 1

Raks_0-1670849903344.png

Image 2

 

Raks_1-1670849961057.png

Wehn I select something expect Pepsi from Maker slicer data is going blank.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.