Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I have created a measure to work out the (Difference) between sales from one to the next; see below.
I am trying to create a measure which will create a net position by summing the (Difference) figures in the last 7 days. The total should be -155,516.48.
I hope that makes sense.
Thanks in advance.
Hi,
Thanks for the quick reply.
Sorry, I'm struggling to understand how to edit the first measure. Also, the second measure isn't picking up the (Difference) measure to sum.
I'm trying to sum this (Difference) number to create a net movement for the 7 days.
Would appreciate your feedback.
Thanks,
Glen
@Anonymous , Try like
Rolling 7 Sales =
var _max = maxx(allselcted(date),date[date]) // or today()
var _min = _max -7
return
CALCULATE(SUM(Sales[Sales Amount]),filter(date, date[date] <=_max && date[date] >=_min))
or
Rolling 7 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY))
User | Count |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |