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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.