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
afbraga66
Helper III
Helper III

Make total as the sum of the rows

Hey,

 

I am having an issue trying to make the target only show values when the real has values. For the rows it is working, but on the total it is displaying the total value of the target despite if the real had value or not. I expected it to show 3,05 instead of 11,15.

afbraga66_0-1687945908618.png

 

This is the measure that I have:

 

Production Defect Target (SUn) =
IF(NOT ISBLANK([Production Defect]),
CALCULATE(
SWITCH (
SELECTEDVALUE ( h_Units[Value] ),
0, BLANK(),
1, SUM(F_TARGETS[# Defect (m3)]),
2, BLANK(),
3, BLANK()
),
ALL(F_PRODUCTION_DEFECT),
F_TARGETS[Source] = "Prod. Defects"
))

 

Any idea how can I fix this? Thank you.

Best regards,

André

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @afbraga66 

please try

Production Defect Target (SUn) =
SUMX (
VALUES ( 'Table'[Defect] ),
IF (
NOT ISBLANK ( [Production Defect] ),
CALCULATE (
IF ( SELECTEDVALUE ( h_Units[Value] ) = 1, SUM ( F_TARGETS[# Defect (m3)] ) ),
ALL ( F_PRODUCTION_DEFECT ),
F_TARGETS[Source] = "Prod. Defects"
)
)
)

View solution in original post

2 REPLIES 2
afbraga66
Helper III
Helper III

Hey,@tamerj1

That work's! thank you very much!

tamerj1
Super User
Super User

Hi @afbraga66 

please try

Production Defect Target (SUn) =
SUMX (
VALUES ( 'Table'[Defect] ),
IF (
NOT ISBLANK ( [Production Defect] ),
CALCULATE (
IF ( SELECTEDVALUE ( h_Units[Value] ) = 1, SUM ( F_TARGETS[# Defect (m3)] ) ),
ALL ( F_PRODUCTION_DEFECT ),
F_TARGETS[Source] = "Prod. Defects"
)
)
)

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.