The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!
Dates | Actuals | Dates | Forecast | Dates | Output | ||
Jan | 4 | Jan | 5 | Jan | 4 | ||
Feb | 5 | Feb | 4 | Feb | 5 | ||
March | 4 | March | 5 | March | 5 | ||
April | April | 5 | April | 5 | |||
May | May | 5 | May | 5 | |||
June | June | 4 | June | 4 |
Solved! Go to Solution.
Hi @VMoza ,
Please try the following formula:
Measure =
IF (
FORMAT ( MAX ( Dim_Dates[Date] ), "yyyymm" ) >= FORMAT ( TODAY (), "yyyymm" ),
SUM ( Forecast[Forecast] ),
SUM ( Actuals[Actuals] )
)
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.
Hi @VMoza ,
Please try the following formula:
Measure =
IF (
FORMAT ( MAX ( Dim_Dates[Date] ), "yyyymm" ) >= FORMAT ( TODAY (), "yyyymm" ),
SUM ( Forecast[Forecast] ),
SUM ( Actuals[Actuals] )
)
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! 😄
@VMoza , You need to have common date column and measures like Actual and Forecast
new measure
if(isblank([Actual]) , [Forecast], [Actual])
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?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
82 | |
63 | |
54 | |
52 |
User | Count |
---|---|
127 | |
118 | |
81 | |
65 | |
64 |