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.
Data looks like this(without 7 days moving), I want to create a measure that creates the 7 days moving which looks at every day and sums the past 7 days of data so I can get a smoother graph at the end. TIA!:
Solved! Go to Solution.
@Marshy , You can have rolling 7 days avg like this
Rolling 7 day = CALCULATE(sum(Table[Number]),DATESINPERIOD('Date'[Date],MAX(Table[Date]),-7,Day))/7
or
Rolling 7 day = CALCULATE(sum(Table[Number])/distinctcount(Table[Date]),DATESINPERIOD('Date'[Date],MAX(Table[Date]),-7,Day))
Custom Running Total =
VAR TimeSpan = 7
VAR MaxVisibleDate =
MAX ( Dates[Date] )
VAR ListOfDates =
FILTER (
ALL ( Dates ),
Dates[Date] <= MaxVisibleDate
&& Dates[Date] > MaxVisibleDate - TimeSpan
)
VAR Result =
CALCULATE ( [Total Sales], ListOfDates )
RETURN
Result
@Marshy , You can have rolling 7 days avg like this
Rolling 7 day = CALCULATE(sum(Table[Number]),DATESINPERIOD('Date'[Date],MAX(Table[Date]),-7,Day))/7
or
Rolling 7 day = CALCULATE(sum(Table[Number])/distinctcount(Table[Date]),DATESINPERIOD('Date'[Date],MAX(Table[Date]),-7,Day))
@amitchandak thanks but I don't fully understand. I don't want avg so assume I can just take out the divide.
what is the difference between
'Date'[Date]
and
Table[Date]
Thanks!
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 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |