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
mjlang85
Frequent Visitor

Summing Error

All, 


I'm having an issue summing.  Here is the calc I'm using for Biz 2. 

 

IF(SUM(Hours[Total Work Hours]) <=0, BLANK(), SUM('Calendar'[Business Hours]))

 

Any ideas?  Disregard Client Rate 2.0

 

 

Summing.PNG

3 REPLIES 3

Hi there,

 

Happy to help. So the issue is that with the IF statement DAX is going row by row in the Pivot Table and checking to see if Total Working Houres is less than or equal to 0. In the Total Row this value is not 0, so it's summing the entire value of Business Hours. Instead I'd recommend using the CALCULATE function.

 

=
CALCULATE (
    SUM ( 'Calendar'[Business Hours] ),
    FILTER ( Hours, SUM ( Hours[Total Work Hours] ) <= 0 )
)

This one will SUM only those values that were above this, at the grand total level. Compared to the IF statement. Let me know if this works for you.

Thanks!  This definitely worked in the table.  So props there.  One more question...  When I put in the grand total column, or a card, as seen below in the picture, the number isn't correct.  The correct number is 24.01.  Any ideas?

 

 

 

 

 

Grand Total.PNG

So my first though would be to see if there's any filters on the table that isn't on the card. Is there any version of the workbook you can share for diagnosis? It helps to know what relationships, tables, etc.. are going into that DAX formula.

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.