March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I have a question to calculate running sum of a formula.
I have a table
I want to calculate the running sum of (Value^2).
I expect to have for each row:
(7^2) = 49
(7^2) + (1^2) = 50
(7^2) + (1^2) + (2^2) = 54
I tried to do it in DAX
Measure 5 =
CALCULATE (
SUM (Master[Value]) * SUM (Master[Value]),
FILTER (
ALL ( Master ),
Master[Date] <= MAX ( Master[Date] )
)
)
But the result is
Anyone can help me for the correct DAX to get 49, 50, and 54 as the running sum?
Any help will be greatly appreciated! Thank you.
Solved! Go to Solution.
@gggar
Use the formula this way:
Value Measure =
var _date = MAX(Master[Date]) return
CALCULATE(
SUMX(VALUES(Master), Master[Value] * Master[Value]),
Master[Date] <=_date
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@gggar
Use the formula this way:
Value Measure =
var _date = MAX(Master[Date]) return
CALCULATE(
SUMX(VALUES(Master), Master[Value] * Master[Value]),
Master[Date] <=_date
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |