Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I followed the excellent Semi Additive mesure guide at sqlbi.com (https://www.sqlbi.com/articles/semi-additive-measures-in-dax/) and now have a report that tracks balences accurately and the measure reports the most recent balance of the quarter.
LastBalance Ever :=
VAR MaxDate =
MAX ( 'Date'[Date] )
VAR LastDates =
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( Balances[Name] ),
ALL ( 'Date' )
),
"LastDay", CALCULATE (
MAX ( 'Balances'[Date] ),
ALL ( 'Date' ),
'Date'[Date] <= MaxDate
)
)
VAR LastDatesWithLineage =
TREATAS (
LastDates,
Balances[Name],
'Date'[Date]
)
VAR Result =
CALCULATE (
SUM ( Balances[Balance] ),
LastDatesWithLineage
)
RETURN
Result
I'm now keen to understand how I would compare changes between the most recent balence and the previous most recent balence. For example;
Supplier | Contract Spend | Effective Date | Change |
A | 10,000.00 | 01/01/2019 | 0% |
A | 15,000.00 | 01/01/2020 | 150% |
A | 10,000.00 | 02/01/2021 | 67% |
Is there a DAX command that would allow me to compare with the previous last balence? Any ideas on how I could approach this?
Solved! Go to Solution.
@Anonymous Please refer to my measure for this sample data:
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
@Anonymous Please refer to my measure for this sample data:
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.