Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
I need to create a bar chart showing the Yearly Forecast for each month -
x axis: Month
y axis: Forecast
Forecast = Actual Cost from Jan to previous month + Budget from this month to Dec.
The bar chart should show the yearly forecast calculated on monthly basis for both historically and prospectively
How to write the DAX function for it? Thank you!!
@Gabiiiii ,First create a measure for Actual Cost Up
ActualCostToDate =
CALCULATE(
SUM(Financials[ActualCost]),
DATESBETWEEN(
'Date'[Date],
DATE(YEAR(TODAY()), 1, 1),
EOMONTH(TODAY(), -1)
)
)
BudgetCostToEndOfYear =
CALCULATE(
SUM(Financials[BudgetCost]),
DATESBETWEEN(
'Date'[Date],
EOMONTH(TODAY(), 0) + 1,
DATE(YEAR(TODAY()), 12, 31)
)
)
YearlyForecast = [ActualCostToDate] + [BudgetCostToEndOfYear]
Use Yearly Forecast measure in Y axis
Proud to be a Super User! |
|
Hi bhanu, really appreciate your reply! However, I have tried similar approach, it will only show the month-on-month value if I use month as the x axis. I need to show the yearly value for each month,
for example:
Jan: Budget from Jan-Dec
Feb: Actual for Jan + Budget from Feb-Dec
...
Also, I do not have a date column to use, only a single "month“ column in text format
I've tried with AllExcept function, it's also not working as expected...
User | Count |
---|---|
17 | |
16 | |
15 | |
13 | |
12 |
User | Count |
---|---|
10 | |
8 | |
7 | |
7 | |
6 |