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

Calculating Delay Rate with Slicers

Hi all,

 

I am fairly new to DAX and am a bit stuck on something, I have tried googling/lurking for a solution to no avail.

 

I'm trying to calculate the delay rate of delivery trucks. I have a table with one row for each delivery, it also includes a column with the delay code. The measure "Delay Rate %" is being used as the values for a column chart with a month axis.

 

It works perfectly when I specify the reason in the measure (example):

Delay Rate % = CALCULATE(SUM(Data[Delivery Complete),Data[Delay Reason]="WEATHER")/SUM(Data[Delivery Complete])

However, I would like the user to be able to select the delay reason from a slicer. (e.g. weather, fuel, customer, traffic, etc)

 

What would be the easiest way to do this? (if at all possible) Thank you for your help in advance. Smiley Happy

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

Get rid of the calculate all together and just keep the division. Add a slicer on your delay reason column, and it will work (after you add the extra calculate below).  Calculate is a hard coded way to apply a filter. A slicer is another way to apply a filter, but it is user selectable

 

you will need to add a new calculate to the denominator so it ignores the slicer. 

 

Denominator should be 

calculate(sum(data[delivery complete]),all(data[delay reason]))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

Get rid of the calculate all together and just keep the division. Add a slicer on your delay reason column, and it will work (after you add the extra calculate below).  Calculate is a hard coded way to apply a filter. A slicer is another way to apply a filter, but it is user selectable

 

you will need to add a new calculate to the denominator so it ignores the slicer. 

 

Denominator should be 

calculate(sum(data[delivery complete]),all(data[delay reason]))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Thank you very much for the prompt reply, Matt! It worked perfectly. 

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.