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

If Empty/0 MAX Sum of one of two columns

So I have a column in a matrix that is kicking my tail and I'm trying to make a calculated column to resolve this. 

It's a column that if no values for that Category in the table are present it turns up blank and that is causing problems in the report. 

Each column represents a table of transactions in the dataset. 


The problem child is the "Cost to Complete" column. If there are adjustments out side of the estimate to a particular category, transaction totals are populated in Cost to Complete and the remaining budget is based on those adjustments.
However if no adjustments are made, the cost to complete column should reflect the higher of the Revised Estimate or the Actual costs.

 

I've tried the below formula but it always is coming up False and using the Cost to Complete. 

= IF(isblank(CALCULATE(SUM(Cost To Complete))),MAX(CALCULATE(SUM(Actual Costs)),CALCULATE(SUM(REvised Estimate))),CALCULATE(SUM(Cost to Complete)))

Untitled.png

It would also seem my Max statement is not doing it's job correctly either as I reversed the true/false formulas and I'm getting a totally off the wall value. 

Looking for some guidance. 

1 REPLY 1
levih
Frequent Visitor

Just if anyone is interested, I was able to achieve my goal. 

Cost At Complete =
VAR CostToComplete = SELECTEDVALUE('Cost to Complete'[Cost to Complete],CALCULATE(SUM('Cost to Complete'[Cost to Complete])))
VAR ActualCosts = SELECTEDVALUE(Costs[Actual Costs],CALCULATE(SUM('Costs'[Actual Costs])))
VAR RevisedEstimate = SELECTEDVALUE('Revised Estimate'[Revised Estimate],CALCULATE(SUM('Revised Estimate'[Revised Estimate])))
return
IF(ISBLANK(CostToComplete),
MAX(RevisedEstimate,ActualCosts),
CostToComplete
)
 
Except for now I'm having issues with the totals not working correctly. UGH

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.