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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
does anyone know how to create a masure that shows the running difference of another column (which is a measure) in a table visual)?
I have a two measures like:
Solved! Go to Solution.
Hi @jmkvalsund ,
You can try this measure
Diff =
VAR CurrentDate = MAX('Table'[DateID])
VAR PreviousDate =
CALCULATE(
MAX('Table'[DateID]),
FILTER(
ALL('Table'),
'Table'[DateID] < CurrentDate
)
)
VAR PreviousSale =
CALCULATE(
SUM('Table'[SaleAmount]),
'Table'[DateID] = PreviousDate
)
RETURN
IF(
ISBLANK(PreviousSale),
0,
SUM('Table'[SaleAmount]) - PreviousSale
)
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Anonymous
Thanks a lot, works great!!
Regards,
John Martin
Hi @Anonymous ,
heres a fictive table created in Excel to show what I want to achieve. Data table to the left and the wanted output to the right.
Note:
The DateID is End-Of-Month for all previous months, since the Saleamount is accumulated by customerID (not shown here since it is not of importance). For current month, DateID is the latest update to PowerBI, typically two days before current date.
My headache is to create the column showing "Diff previous month". Which is just the difference in M_Sum_Selected_Seller for each DateID.
Regards,
John Martin
Hi @jmkvalsund ,
You can try this measure
Diff =
VAR CurrentDate = MAX('Table'[DateID])
VAR PreviousDate =
CALCULATE(
MAX('Table'[DateID]),
FILTER(
ALL('Table'),
'Table'[DateID] < CurrentDate
)
)
VAR PreviousSale =
CALCULATE(
SUM('Table'[SaleAmount]),
'Table'[DateID] = PreviousDate
)
RETURN
IF(
ISBLANK(PreviousSale),
0,
SUM('Table'[SaleAmount]) - PreviousSale
)
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
I'm feeling a bit stupid now, but could you show me how to create another measure which accumulates the values from Diff for each DateID?
Regards,
John Martin
Hi @jmkvalsund ,
Can you provide some sample data? We can better understand the problem and help you.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.