Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi everyone,
I’m working on a DAX expression to calculate a display value for a line chart in Power BI. My goal is to correctly handle data for the current month and future months with the following requirements:
Here's the DAX expression I have so far:
Display Value =
VAR IsCurrentMonth =
YEAR([Date]) = YEAR(TODAY()) &&
MONTH([Date]) = MONTH(TODAY())
VAR IsFutureMonth =
YEAR([Date]) > YEAR(TODAY()) ||
(YEAR([Date]) = YEAR(TODAY()) && MONTH([Date]) > MONTH(TODAY()))
VAR CurrentMonthActualCumulativeSum =
CALCULATE(
MAX([Actual Cumulative.Sum]),
FILTER(
ALLSELECTED(),
YEAR([Date]) = YEAR(TODAY()) &&
MONTH([Date]) = MONTH(TODAY())
)
)
RETURN
IF(
[Series Type] = "Rolling Wave Forecast",
IF(
IsCurrentMonth,
[Actual+Rolling Wave Forecast],
IF(
IsFutureMonth,
CurrentMonthActualCumulativeSum + [Value],
[Actual+Rolling Wave Forecast]
)
),
[Value]
)
Thank you!
(Images with captions are below)
Data in Table Visual
Line Graph - Values at August 2024 Data Point
Line Graph - Values at September 2024 Data Point (Notice the previous Actual from July was added to Rolling Wave)
Line Graph - Values at October 2024 Data Point (Notice the previous Actual from July was added to Rolling Wave)
Hi everyone,
Thank you for your previous assistance. I need to provide additional context regarding my issue.
I'm using the following DAX expression to display data on the y-axis:
Cumulative Spend NEW =
CALCULATE(
SUM('Budget/Spend by Category'[Display Value2]),
FILTER(ALL('Calendar'[Date]), 'Calendar'[Date] <= MAX('Calendar'[Date]))
)
@Anonymous
Hi @Jules102
I tried to reproduce your situation, but I found that I didn't have your specific data
I've also double-checked the dax you offered, according to your logic, there is no problem with it.
So I speculate that maybe the [Value] is the problem.
If possible, could you please provide some raw data(exclude sensitive data), or create some sample data, so that we can help you better.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Jules102 , First I would like to say good work in explaining the issue , please find the updated measure try using it once
Display Value =
VAR IsCurrentMonth =
YEAR([Date]) = YEAR(TODAY()) &&
MONTH([Date]) = MONTH(TODAY())
VAR IsFutureMonth =
YEAR([Date]) > YEAR(TODAY()) ||
(YEAR([Date]) = YEAR(TODAY()) && MONTH([Date]) > MONTH(TODAY()))
VAR CurrentMonthActualCumulativeSum =
CALCULATE(
MAX([Actual Cumulative.Sum]),
FILTER(
ALLSELECTED('YourTableName'),
YEAR([Date]) = YEAR(TODAY()) &&
MONTH([Date]) = MONTH(TODAY())
)
)
VAR FutureMonthForecastValue =
CALCULATE(
SUM([Value]),
FILTER(
ALLSELECTED('YourTableName'),
[Series Type] = "Rolling Wave Forecast" &&
[Date] = EARLIER([Date])
)
)
RETURN
IF(
[Series Type] = "Rolling Wave Forecast",
IF(
IsCurrentMonth,
[Actual+Rolling Wave Forecast],
IF(
IsFutureMonth,
CurrentMonthActualCumulativeSum + FutureMonthForecastValue,
[Actual+Rolling Wave Forecast]
)
),
[Value]
)
Proud to be a Super User! |
|
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 11 | |
| 10 | |
| 8 | |
| 8 |