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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MR2001
Helper II
Helper II

Filtering records based on a slicer

I have the following calculated column that works correctly:

 

Total PCR = 
VAR Date1 = 'Table1'[date]
RETURN
CALCULATE (
SUM ('Table1'[Total] ),
FILTER (
'Table1',
'Table1'[date] <= Date1), 
FILTER( 'Table1', 'Table1'[Request_Type] = "Defect")
)

 

If I remove however the highlighted part and add a slicer based on [Request_Type] instead, it does not work correctly anymore. I was hoping a filter will change the way column calculates but it doesn't... Selecting "Defect" from the slicer does not produce the same result.

[Request_Type] column has three possible values: "Defect", "Enhancement", "Change".

 

How can I make it work based on a filter/slicer?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Have you tried creating that as a measure instead of a calculated column?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Have you tried creating that as a measure instead of a calculated column?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Problem solved.
Measure:

 

Total PCR1 =
CALCULATE (
SUM ('Table1'[Total]),
FILTER ( ALL ('Table1'), Table1'[date] <= MAX ( Table1'[date] ) ),
VALUES(Table1[Request_Type] )
)

 

Note: the key was adding VALUES(Table1[Request_Type] ) as demonstrated in: http://community.powerbi.com/t5/Desktop/DAX-Running-total-by-another-column/m-p/10517#M2191

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors