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 Experts,
I'm trying to create a measure that calculates the cummulative subtraction of two measures.
I have the following three measures:
lpf_not_solved = SUM('Weekly LPF'[Not solved curve])
baseline_solved = SUM('LPF Baseline test'[Baseline_Solved_Value])
cum_subtract = [lpf_not_solved] - [baseline_solved]
cum_subtract is not correct and I have tried multiple things to achieve the desired output without luck.
The expected output is visualized below:
Both 'Weekly LPF' and 'LPF Baseline test' have a one-to-many relationship to the DateTable:
Any idea how to solve this?
Thank you for your input and time! It's much appreciated.
Solved! Go to Solution.
Hi @Anonymous
please try
cum_subtract =
VAR CurrentDate =
MAX ( DateTable[Date] )
VAR SelectedDates =
ALLSELECTED ( DateTable[Date] )
VAR WeeklyTable =
ADDCOLUMNS ( SelectedDates, "@NotSolved", [lpf_not_solved] )
VAR T1 =
FILTER (
WeeklyTable,
DateTable[Date] <= CurrentDate
&& [@NotSolved] <> BLANK ()
)
VAR T2 =
TOPN ( 1, T1, DateTable[Date] )
VAR NotSolved =
MAXX ( T2, [@NotSolved] )
VAR BaselineTable =
ADDCOLUMNS ( SelectedDates, "@Solved", [baseline_solved] )
VAR T3 =
FILTER ( BaselineTable, DateTable[Date] <= CurrentDate )
VAR T4 =
FILTER ( T3, [@Solved] = BLANK () )
VAR LastBlank =
MAXX ( T4, DateTable[Date] )
VAR T5 =
FILTER ( T3, DateTable[Date] > LastBlank )
VAR Solved =
SUMX ( T5, [@Solved] )
RETURN
NotSolved - Solved
Hi @Anonymous
please try
cum_subtract =
VAR CurrentDate =
MAX ( DateTable[Date] )
VAR SelectedDates =
ALLSELECTED ( DateTable[Date] )
VAR WeeklyTable =
ADDCOLUMNS ( SelectedDates, "@NotSolved", [lpf_not_solved] )
VAR T1 =
FILTER (
WeeklyTable,
DateTable[Date] <= CurrentDate
&& [@NotSolved] <> BLANK ()
)
VAR T2 =
TOPN ( 1, T1, DateTable[Date] )
VAR NotSolved =
MAXX ( T2, [@NotSolved] )
VAR BaselineTable =
ADDCOLUMNS ( SelectedDates, "@Solved", [baseline_solved] )
VAR T3 =
FILTER ( BaselineTable, DateTable[Date] <= CurrentDate )
VAR T4 =
FILTER ( T3, [@Solved] = BLANK () )
VAR LastBlank =
MAXX ( T4, DateTable[Date] )
VAR T5 =
FILTER ( T3, DateTable[Date] > LastBlank )
VAR Solved =
SUMX ( T5, [@Solved] )
RETURN
NotSolved - Solved
@Anonymous See if this helps: Better Running Total - Microsoft Power BI Community
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 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 8 | |
| 8 | |
| 7 |