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
Clint_
New Member

Help needed. How to calculate %. Denominator is being changed by a slicer?

I am having trouble with the denominator in a division calculation.  The denominator is being changed when items in a slicer are selected.  I have used REMOVE FILTERS and ALL functions in the measure calculating the denominator, however the denominator value still changes when individual items in the slicer are selected.  The only exception is when the "Blank"  item in the slicer is selected combined with another slicer option (see below).  How do I stop the slicer from changing this measure.  ("Edit Interactions" option is not appropriate).

 

I am calculating the number of Total Tasks with Errors and slicing  by the "Error Reason" .  "Blank" in the "Error Reason" column represents Tasks that have no errors.  "Tasks with Errors " is an number column & "Error Reason" is a text column.

 

Your help is appreciated.

 

Measure used:

Reason % =

Var Numerator = CALCULATE(SUM('Worksheet'[TasksWithErrors]))
Var Denominator = CALCULATE(SUM('Worksheet'[TasksWithErrors])), REMOVEFILTERS('Worksheet'[ErrorReason]))

RETURN
DIVIDE(Numerator,Denomoinator,0)
 
Visuals
Clint__5-1642237612209.png

Visuals when Slicer selected

Clint__4-1642237529851.png

 

 

What happens when the "Blanks" are selected in the slicer

Clint__3-1642236369043.png

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

ALL should work here without problems since you are tring to calculate the total without filters. Here is a working DAX:

Var Denominator = CALCULATE(SUM('Worksheet'[TasksWithErrors])), ALL('Worksheet')

RETURN


Additionally you don't need CALCULATE here:
Var Numerator = SUM('Worksheet'[TasksWithErrors])


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!







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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Clint_
New Member

Thanks for the help ValtteriN.
It appears that the "Blanks" were not the issue after all. The ALL function worked, however I have a time slicer on the page. I used ALLEXCEPT the Time Slicer in the Denominator Measure and the issue reappeared. I now believe that the Total Tasks is being impacted by the Time slicer which is in-turn modified by the Error Reason, and thus producing incorrect result. I will build a separate Calendar Table and see if this will work.

ValtteriN
Super User
Super User

Hi,

ALL should work here without problems since you are tring to calculate the total without filters. Here is a working DAX:

Var Denominator = CALCULATE(SUM('Worksheet'[TasksWithErrors])), ALL('Worksheet')

RETURN


Additionally you don't need CALCULATE here:
Var Numerator = SUM('Worksheet'[TasksWithErrors])


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!







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

Proud to be a Super User!




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.

Top Solution Authors