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

Trying to get the total sum correct based on previous given condition

Hi All!

I'm pretty new to DAX code and to Power BI in general, I'm facing an issue right now where I can't get the total sum correct based on previous given condition:

AleGuty04_1-1687199928350.png

 


Basically what I'm trying to do is to get only the IF Fines if the are above the 98% column (IF%) but instead I'm getting the total sum as it was ignoring my previous condition as you can see in above picture, here's the formula:

IF Fines DAX = if([IF %] > .98, 0,
CALCULATE(
[Sum of if fines],
ALLEXCEPT(' Date', 'Date'[Month Year])))

I tried some work-arounds but without any luck, does anyone know how I can get the correct total sum for the IF Fines column?

Also, this is a DirectQuery Model so take that in mind as I'm limited to create calculated columns
 
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@AleGuty04,

 

Try this measure:

 

IF Fines DAX =
SUMX (
    VALUES ( YourTableName[customer_vendor_num] ),
    IF ( [IF %] <= .98, [Sum of if fines] )
)

 

Here's an article on totals:

 

https://www.sqlbi.com/articles/why-power-bi-totals-might-seem-inaccurate/ 





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
DataInsights
Super User
Super User

@AleGuty04,

 

Try this measure:

 

IF Fines DAX =
SUMX (
    VALUES ( YourTableName[customer_vendor_num] ),
    IF ( [IF %] <= .98, [Sum of if fines] )
)

 

Here's an article on totals:

 

https://www.sqlbi.com/articles/why-power-bi-totals-might-seem-inaccurate/ 





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

Proud to be a Super User!




This is exactly what I needed, thank you so much!

Helpful resources

Announcements
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