Forum Discussion
OKgo
Helper IV
8 years agoCummulative sum visible in edit queries
Within PowerBi is there a way to have a cumulative total visible in the edit queries screen? This is how I would tackle this in Excel. Sort by "unique' then by "date", simple IF formula: t...
- 8 years ago
Hi OKgo,
To get a cumulative total column, please try:
Running total Col = CALCULATE ( SUM ( 'Table1'[Value] ), FILTER ( ALLEXCEPT ( 'Table1', 'Table1'[unique] ), Table1[Date] <= EARLIER ( Table1[Date] ) ) )To create a running total measure, please refer to:
Running total measure = CALCULATE ( SUM ( Table1[Value] ), FILTER ( ALLEXCEPT ( Table1, Table1[unique] ), Table1[Date] <= MAX ( Table1[Date] ) ) )Best regards,
Yuliana Gu
v-yulgu-msft
Microsoft Employee
8 years agoHi OKgo,
To get a cumulative total column, please try:
Running total Col =
CALCULATE (
SUM ( 'Table1'[Value] ),
FILTER (
ALLEXCEPT ( 'Table1', 'Table1'[unique] ),
Table1[Date] <= EARLIER ( Table1[Date] )
)
)
To create a running total measure, please refer to:
Running total measure =
CALCULATE (
SUM ( Table1[Value] ),
FILTER (
ALLEXCEPT ( Table1, Table1[unique] ),
Table1[Date] <= MAX ( Table1[Date] )
)
)
Best regards,
Yuliana Gu
- OKgo8 years ago
Helper IV
Dear Yuliana, thank you so much! That was exactly the breakthough I needed. I added the column in the modelling tab and the graphs work great. Can you please explain how you got your first screenshot? It looks like a preview from the edit queries screen which looks great.