In your dataset, it seems that each player does not have data for each day. I assume you want the moving average based on the existing 7 days in Seances_Joueurs table. (For PISCIONE, days are 7/7/2016, 7/9/2016, 7/12/2016 …)
First, create a column to rank the date for each player with following formula.
I have an equal problem, but instead of calculating the average i do the distinct count the last 14 days. In my data model I have created a Date table using "Date = CALENDARAUTO()" that I use as a slider for my "Line and Clustered Column Chart", and I'm using the Date in the Hierarchy format as the Shared Axis.
I'm using the formula below to calculate the distinct number the last 14 days:
Customers Last 14 days = CALCULATE(DISTINCTCOUNT(TransactionData[Customer]),DATESINPERIOD('Date'[Date],LASTDATE('Date'[Date]),-14,DAY))
The DistinctCount for the current period (Day, Month, Quater, Year, depending on if I Drill Up of Down the diagram) I show as Bars
The DistinctCount for the last 14 days I show as a Line
I have also added a YearToDate measure that I show as a Second Line
I have two problems:
The calculations continues (and the value decreases) even after my current date (today it's the 6'th of September, so I have values untill the 19'th of September). This is easy to see when I list the values in a table
The last 14 days line does not show up for the last month when I Drilled to the Month based view in the diagram. The same goes for Quater and Year. Drilling down to the day view will show the "last 14 days line" up to todays date. Although, this is kind of strange, since I also have seen the "last 14 days line" streching out to the coming 13 days as I described as a problem above. Maybe Microsoft has fixed this in the later versions. But still, there's a problem that I don't see the "last 14 days line" extended into my current month. Using a YTD measure, this line do extend into the current month