Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm building a cumulative cost over time line chart (budget/forecast/actual). The light green line is Cumulative Actuals, and I'm looking for a solution for the line to stop in the most recent month with actuals instead of extending the flat line to future months. Below is the current measure for deriving the cumulative line. Can I add another filter in this measure or create another measure to determine what the last date where Actuals are not blank so the line stops on that date? Thank you.
Solved! Go to Solution.
Hi @Anonymous ,
Sorry for late reply, we can try to create measure use the following formula.
Cumulative Actuals =
VAR maxActualDate =
CALCULATE (
MAX ( 'Finance Sheet'[DateFinance] ),
FILTER ( ALLSELECTED ( 'Finance Sheet' ), 'Finance Sheet'[Actual] <> BLANK () )
)
RETURN
IF (
MAX ( 'Finance Sheet'[DateFinance] ) <= maxActualDate,
CALCULATE (
SUM ( 'Finance Sheet'[Actual] ),
FILTER (
ALLSELECTED ( 'Finance Sheet'[DateFinance] ),
ISONORAFTER (
'Finance Sheet'[DateFinance], MAX ( 'Finance Sheet'[DateFinance] ), DESC
)
)
),
BLANK ()
)
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can change the formula as following to meet you requirement:
Cumulative Actuals =
VAR maxActualDate =
CALCULATE ( MAX ( 'Finance Sheet'[DateFinance] ), ALL ( 'Finance Sheet' ) )
RETURN
IF (
MAX ( 'Finance Sheet'[DateFinance] ) <= maxActualDate,
CALCULATE (
SUM ( 'Finance Sheet'[Actual] ),
FILTER (
ALLSELECTED ( 'Finance Sheet'[DateFinance] ),
ISONORAFTER (
'Finance Sheet'[DateFinance], MAX ( 'Finance Sheet'[DateFinance] ), DESC
)
)
),
BLANK ()
)
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I don't believe this works correctly. Your maxActualDate appears to be finding the max value in DateFinance column. However, I need to find the max value in DateFinance column where Actual column is not blank. Any assistance is appreciated.
Thanks
Hi @Anonymous ,
Sorry for late reply, we can try to create measure use the following formula.
Cumulative Actuals =
VAR maxActualDate =
CALCULATE (
MAX ( 'Finance Sheet'[DateFinance] ),
FILTER ( ALLSELECTED ( 'Finance Sheet' ), 'Finance Sheet'[Actual] <> BLANK () )
)
RETURN
IF (
MAX ( 'Finance Sheet'[DateFinance] ) <= maxActualDate,
CALCULATE (
SUM ( 'Finance Sheet'[Actual] ),
FILTER (
ALLSELECTED ( 'Finance Sheet'[DateFinance] ),
ISONORAFTER (
'Finance Sheet'[DateFinance], MAX ( 'Finance Sheet'[DateFinance] ), DESC
)
)
),
BLANK ()
)
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've just sorted this for myself, try using the following;
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
69 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |