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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
VMoza
Frequent Visitor

Change Column Reference

Hi,

 

Fairly new to Power BI and would like to understand how I can possibly change the reference column to SUM if the month has not ended.

FX I have two tables, one with Actuals and one with Forecast and several DIM tables for Dates and Products or Accounts.

Would like to SUM Actuals for every month that has passed and from current month and forward to SUM the Forecast numbers.

 

What would the formula look like?

 

Thank you!

 

DatesActuals DatesForecast DatesOutput
Jan4 Jan5 Jan4
Feb5 Feb4 Feb5
March4 March5 March5
April  April5 April5
May  May5 May5
June  June4 June4
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @VMoza ,

 

Please try the following formula:

 

Measure = 
IF (
    FORMAT ( MAX ( Dim_Dates[Date] ), "yyyymm" ) >= FORMAT ( TODAY (), "yyyymm" ),
    SUM ( Forecast[Forecast] ),
    SUM ( Actuals[Actuals] )
)

vkkfmsft_0-1649037320666.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-kkf-msft
Community Support
Community Support

Hi @VMoza ,

 

Please try the following formula:

 

Measure = 
IF (
    FORMAT ( MAX ( Dim_Dates[Date] ), "yyyymm" ) >= FORMAT ( TODAY (), "yyyymm" ),
    SUM ( Forecast[Forecast] ),
    SUM ( Actuals[Actuals] )
)

vkkfmsft_0-1649037320666.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you! This worked! 😄 

amitchandak
Super User
Super User

@VMoza , You need to have common date column and measures like Actual and Forecast

new measure

if(isblank([Actual]) , [Forecast], [Actual])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Thank you for the quick reply, not sure if the ISBLANK would work, as there is new data for every day in March, therefore the actuals for the month would not be Blank, or am I getting this wrong?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.