Forum Discussion
Cumulative dax query help
Hi GuestUser
Try this pattern.
Cumulative Quantity :=
CALCULATE (
SUM ( Transactions[Quantity] ),
FILTER (
ALL ( 'Date'[Date] ),
'Date'[Date] <= MAX ( 'Date'[Date] )
)
)
Read this article for more info
https://www.daxpatterns.com/cumulative-total/
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Hi Mariusz
have tried this and its giving same value for all items same like transaction count
need the cumulative value item wise
any suggestion pls
- v-eachen-msft6 years agoCommunity Support
Hi GuestUser ,
You need to group by Year with ALLEXCEPT() function.
Refer to the following DAX:
Measure = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Year] ), 'Table'[Value] <= MAX ( 'Table'[Value] ) ) )Here is the result.
- GuestUser6 years agoHelper V
Thanks !!
The Item column is from different table and Value Column is from different table like
Item Dimesnion - Item
Fact - Value
Date Dimesnion -- Year
Tried this
Measure =
CALCULATE (
SUM ( 'Fact'[Value] ),
FILTER (
ALLEXCEPT ( 'Fact', 'Date'[Year] ),
'Fact'[Value] <= MAX ( 'Fact'[Value] )
)
)But it didnt work as expected...any suggestions pls
- v-eachen-msft6 years agoCommunity Support
Hi GuestUser ,
Could you please share your sample data here if you don't have any Confidential Information? Please upload your files to OneDrive for Business and share the link here.
- Mariusz6 years agoCommunity Champion
Hi GuestUser
Would you mind to:
- Create a data sample
- Provide an expected result based on that sample
- Provide the DAX expression that you have tried
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn