Forum Discussion
Running Total Dax help
Hi, srinivas258
Based on your description, I created data to reproduce your scebario.
Table:
You may create two measures as below.
Total =
var _stop = SELECTEDVALUE('Table'[Stop])
return
SUMX(
FILTER(
ALLSELECTED('Table'),
'Table'[Stop]<=_stop
),
'Table'[Stop]
)
Running Total =
var _stop = SELECTEDVALUE('Table'[Stop])
var tab =
ADDCOLUMNS(
ALLSELECTED('Table'),
"Total",
CALCULATE(
SUM('Table'[Stop]),
FILTER(
ALLSELECTED('Table'),
'Table'[Stop]<= EARLIER('Table'[Stop])
)
)
)
var newtab =
ADDCOLUMNS(
tab,
"Runnung Total",
var t = [Total]
return
SUMX(
FILTER(
tab,
[Total] <= t
),
'Table'[Total]
)
)
return
SUMX(
FILTER(
newtab,
[Stop] = _stop
),
[Runnung Total]
)
Result:
I wonder what the column from another table is like and if there is a relationship between two tables.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- srinivas2586 years agoHelper I
Hi v-alq-msft , amitchandak ,
Apologies for not being clear. Stop and Total are from same table. I have an other column (Stop Description) from other table and I would like to add that to this Running Total table. And there is join in place between these two tables. I tried using lookupvalue for had no luck.
- v-alq-msft6 years agoCommunity Support
Hi, srinivas258
Could you please show some sample data and the expected result with OneDrive for business? Do mask sensitive data before uploading. Thanks.
Best Regards
Allan