Hi all,
I have put together the below measure which gives a sum of all sales within my organisation over the past 7 days.
Hi @Anonymous ,
Do the suggestions from engineers make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best regards
Amy
Hi @Anonymous ,
You may change your measure like DAX below.
7 Days Sales =
CALCULATE (
COUNT ( 'Sales'[IDNumber] ),
FILTER (
ALLEXCEPT ( 'Sales', [Salesperson] ),
'Sales'[Sales Date]
>= TODAY () - 7
)
)
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Just on a side note, if you want the 7 days calculation, you should be using 'FILTER(All('Sales'), 'Sales'[Sales Date] >= TODAY()-6)) in your expressions:
Proud to be a Super User!
Paul on Linkedin.
@Anonymous , You can have it like this with a date table
Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX(Sales[Sales Date]),-7,Day))
Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-7,Day))
But this sometimes can group data into one bucket. You can check this solution for that
https://www.youtube.com/watch?v=duMSovyosXE
Hi, thanks so much for this. Can you advise please how the code could be amended so that it returned sales between 2 and 9 days ago?
Your code is
Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-7,Day))
Changing the 7 to a 9 is easy enough but not sure how to work with the MAX part to make it 2 days ago on a rolling basis?
Thank you
@Anonymous Try:
7 Days Sales = CALCULATE(COUNT('Sales'[IDNumber]), FILTER(ALLSELECTED('Sales'), 'Sales'[Sales Date] >= TODAY()-7))
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
User | Count |
---|---|
118 | |
75 | |
65 | |
51 | |
49 |
User | Count |
---|---|
184 | |
104 | |
82 | |
79 | |
78 |