Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bradc
Frequent Visitor

DAX Measure not summing correctly

Hi All,

Apologies if this is solved elsewhere.

 

I have 2 data sets related by date.  The first data set contains an Actual amount, the second data set contains a forecast amount.

What I need to do is create a calculated column that ignores the Forecast value if an Actual value is present, but when an Actual value is not present displays the Forecast value.  I have done this with the following measure:

Measure = if(ISblank(Sum('Actual'[Act])),Sum(Forecast[Forecast]),sum(Actual[Act]))

The issue is that the measure column fails to Sum correctly.

 

2019-01-31 17_55_26-Window.png

The highlighted value should read the same as the Forecast column, but it appears only the first 3 values are being summed?

 

is anyone able to assist in highlighting what I need to do to have this measure column calculate correctly.

 

Cheers

Brad

1 ACCEPTED SOLUTION
bradc
Frequent Visitor

Hi All,

 

A little more searching and I found a solution.

Thanks @Greg_Deckler.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

the solution I used:

Measure1 = 
VAR __table = SUMMARIZE('Date',[Date],"__value",[Measure])
RETURN
IF(HASONEVALUE('Date'[Date]),[Measure],SUMX(__table,[__value]))

View solution in original post

1 REPLY 1
bradc
Frequent Visitor

Hi All,

 

A little more searching and I found a solution.

Thanks @Greg_Deckler.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

the solution I used:

Measure1 = 
VAR __table = SUMMARIZE('Date',[Date],"__value",[Measure])
RETURN
IF(HASONEVALUE('Date'[Date]),[Measure],SUMX(__table,[__value]))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.