Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have a Date table and fact table related by field called Year
I want to achieve a table like this:
Year | MonthNo | sales | Monthly Cumulative |
2022 | 01 | 20 | 20 |
2022 | 02 | 30 | 50 |
2022 | 03 | 40 | 90 |
2022 | 04 | 50 | 140 |
I have used this dax to obtain this measure Monthly cumulative:
Monthly cumulative=
calculate(sum(sales),
filter(allselected('Date'),
'Date'[Dates]<=Max('Date'[Dates])))
But the result is
140
140
140
140
I want to this in a bar graph too.
How do i do this?
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.
Monthly cumulative =
CALCULATE (
SUM ( sales[revenue] ),
FILTER ( ALLSELECTED ( 'Date'[Dates] ), 'Date'[Dates] <= MAX ( 'Date'[Dates] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
please check your relationship of date and sale table and also filter direction of table.
Thanks guys. I got the answer when I was just posting this question. However, the reply button deactivated, when I want to say.. I got the answer.
Thanks again for looking into it.
please check your relationship of date and sale table and also filter direction of table.
Hi,
I am not sure how your datamodel looks like, but please try something like below whether it suits your requirement.
Monthly cumulative =
CALCULATE (
SUM ( sales[revenue] ),
FILTER ( ALLSELECTED ( 'Date'[Dates] ), 'Date'[Dates] <= MAX ( 'Date'[Dates] ) )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
User | Count |
---|---|
80 | |
77 | |
63 | |
48 | |
44 |
User | Count |
---|---|
101 | |
43 | |
39 | |
39 | |
36 |