Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello Everyone!!
I am trying to obtain the accumulated sales in a chart. I used this formula as a measure:
Accumulated Sales = CALCULATE (SUM(orders[value]),FILTER (ALL ( 'Calendar' ),'Calendar'[Date] <= MAX ( 'Calendar'[Date])))
So with that, when I use a date FILTER, for example, april, 2021. It won't start the accumulated sales first line as the total sales of april 1st, it will get the accumulated from all the previous days and months, like this:
As you can see, the column sales represents total sales from each day of april, but the accumulated sales gets all the data since 2017.
I will be very grateful if someone could help me!
Thank you very much in advance!
Solved! Go to Solution.
Hi, @Anonymous
Please try the below.
Instead of using ALL in your measure, replace it with ALLSELECT.
Accumulated Sales =
CALCULATE (
SUM ( orders[value] ),
FILTER ( ALLSELECT ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
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.
Hi, @Anonymous
Please try the below.
Instead of using ALL in your measure, replace it with ALLSELECT.
Accumulated Sales =
CALCULATE (
SUM ( orders[value] ),
FILTER ( ALLSELECT ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
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.
Hi,
Try this measure
=calculate(SUM(orders[value]),datesmtd(calendar[date]))
Hope this helps.
@Anonymous - Take a look at https://www.daxpatterns.com/cumulative-total/ specifically Measure in the Sales table. With my sample data I got:
Measure 2 =
VAR LastVisibleDate = MAX(TableName[Date])
VAR DatesToSum =
FILTER(
ALLSELECTED(TableName[Date]),
TableName[Date] <= LastVisibleDate
)
VAR Result =
CALCULATE(
SUM(TableName[Sales]),
DatesToSum
)
RETURN
Result
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
131 | |
80 | |
53 | |
38 | |
35 |
User | Count |
---|---|
207 | |
82 | |
75 | |
55 | |
50 |