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
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
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