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
Anonymous
Not applicable

Merging Two Cumulative Lines

Hi all,

 

I have two measures -

 

Actual Cumulative Cost = CALCULATE(SUM('K:01303 (Combined)'[Cost]),FILTER(ALL('K:01303 (Combined)'),'K:01303 (Combined)'[Month]<=MAX('K:01303 (Combined)'[Month])&&'K:01303 (Combined)'[Cost Type]="Actual Cost"))

Forecasted Cumulative Cost = CALCULATE(SUM('K:01303 (Combined)'[Cost]),FILTER(ALL('K:01303 (Combined)'),'K:01303 (Combined)'[Month]<=MAX('K:01303 (Combined)'[Month])&&'K:01303 (Combined)'[Cost Type]="Forecast"))
 

I have the original cost values set up where the Forecast costs show as 0 if they are posted before today's date. I've highlighted what I'd like to stay. The 2nd chart is from Excel and shows how I would like it to look. Is there a simple way to combine these while hiding the non-highlighted part?

 

Also, since the measures are created in DAX, any additional changes, I assume, would also have to be in DAX and not an m-formula. 

 

Merged Cumulative Costs.PNGMerged Cumulative Costs_Excel.PNG

 

Thanks,

Robyn

1 ACCEPTED SOLUTION

@Anonymous , try like

if([Forecasted Cumulative Cost])<>0,[Forecasted Cumulative Cost]+[Actual Cumulative Cost],[Actual Cumulative Cost])

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , try like

if(not(isblank([Forecasted Cumulative Cost])),[Forecasted Cumulative Cost]+[Actual Cumulative Cost],[Actual Cumulative Cost])

Anonymous
Not applicable

@amitchandak I get an error "Model object names must be non-empty". Not sure what this means but I don't believe any of my values are blank. 

@Anonymous , try like

if([Forecasted Cumulative Cost])<>0,[Forecasted Cumulative Cost]+[Actual Cumulative Cost],[Actual Cumulative Cost])

Anonymous
Not applicable

@amitchandak This works. Thank you! Now I just need to find a visual that lets me define the series by both column and line. Thank you!

 

Robyn

jthomson
Solution Sage
Solution Sage

I would have thought just making a measure adding the two things together would work...

Anonymous
Not applicable

@jthomson  I guess technically that would work, but wouldn't I lose the cost type/color variance if they became one value?

 

Robyn

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.