Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am trying to create cumulative sales(Running Totals) for a month,
this is the formula I am using to calculate cumulative sales
# Cumulative Sales =
Solved! Go to Solution.
Hi @Anonymous ,
If you want to show a running total of some dates in a table, you can also create the measure using following DAX:
Cumulative Sales = SUMX ( FILTER ( ALL ( Dates ), Dates[Date] <= SELECTEDVALUE ( Dates[Date] ) ), [DailySales] )
BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
Hi @Anonymous
By using ALLSELECTED ( Dates ) in your filter expression, you are preserving filters coming from outside the visual therefore by selecting a date in the top visual you still apply the filters in your measure, try using ALL( Dates ) instead.
Hi @Mariusz ,
I have tried using All(dates), but it is giving me all the sales, i.e. even are filtering to use only one date, it is showing all the sales.
Regards,
Prime
Hi @Mariusz ,
As shown in the above picture, when I select the 04/09/2019 from the table the matrix should also reflect the same cumulative sales values which is 19,736, but instead it is showing 10,769.
If I dont select any dates the matrix is showing the right values, but when I select any date from the table the matix is showing wrong data.
Thanks in advance.
Regards,
Prime
Hi @Anonymous ,
If you want to show a running total of some dates in a table, you can also create the measure using following DAX:
Cumulative Sales = SUMX ( FILTER ( ALL ( Dates ), Dates[Date] <= SELECTEDVALUE ( Dates[Date] ) ), [DailySales] )
BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
Hi @Anonymous
The below expression is standard practice for Running Totals.
CALCULATE( [# Sales], FILTER ( ALL( Dates[Date] ), Dates[Date] <= MAX ( Dates[Date] ) ) )
Please let me know if it's working for you.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |