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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hey everyone,
This looks like it should be a simple problem, but I'm struggling with it!
How do I calculate a cumulative total of a constant value?
So in the table below, I have created a constant measure, MY NUMBER and in the Running NUMBER column I want it to show: 13, 26,39,52.
This is what I've tried :
Thanks in advance! 🙂
Solved! Go to Solution.
Running_Target =
VAR _current_week = SELECTEDVALUE('Date Table'[YearWeek])
VAR _weekly_target = [Weekly Target 4wk]
VAR _tbl =
ADDCOLUMNS(
ALLSELECTED('Date Table'[YearWeek]),
"@Target", _weekly_target
)
VAR _result =
SUMX(
FILTER(
_tbl,
'Date Table'[YearWeek] <= _current_week
),
[@Target]
)
RETURN
_result
@MichaelF1 Are you sorting the week by another column?
Also can you check one sec and remove the my number column / measure from the table and tell me what you get
Hi @SpartaBI , thanks for the quick response!
I'm not sorting by any other column.
This is what I get when I remove the Running NUMBER column:
Running_Target =
VAR _current_week = SELECTEDVALUE('Date Table'[YearWeek])
VAR _weekly_target = [Weekly Target 4wk]
VAR _tbl =
ADDCOLUMNS(
ALLSELECTED('Date Table'[YearWeek]),
"@Target", _weekly_target
)
VAR _result =
SUMX(
FILTER(
_tbl,
'Date Table'[YearWeek] <= _current_week
),
[@Target]
)
RETURN
_result
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |