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.
Hi,
This must be simple but its beaten me.. All I need is a measure to calulate just the last 7 days average revenue..
Table is below, each line is a sale on the date specified.
All I want is the average daily total for the last 7 days.. so totaling all sales from yesterday, back 7 days and providing the average..
thanks
Solved! Go to Solution.
@JamesBowdidge OK, how about:
Measure =
VAR __Date = MAX('Table'[Booked Date])
VAR __MaxDate = __Date - 1
VAR __MinDate = __MaxDate - 7
VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[Booked Date] >= __MinDate && [Booked Date] <= __MaxDate),[Booked Date],"__LRev",SUM('Table'[LRev]))
RETURN
AVERAGEX(__Table,[__LRev])
@JamesBowdidge Try:
Measure =
VAR __Date = MAX('Table'[Booked Date])
VAR __MaxDate = __Date - 1
VAR __MinDate = __MaxDate - 7
RETURN
AVERAGEX(FILTER(ALL('Table'),[Booked Date] >= __MinDate && [Booked Date] <= __MaxDate),[LRev])
Hi Mate, contrary to saying its the solution (hit the wrong button)
Your formular seems to be averaging the last 7 records (and returns 62.90, rather then the expected 170,000 ish)..
I need the sum of each of the 7 days sales, and then average those numbers..
thanks for your help!
@JamesBowdidge OK, how about:
Measure =
VAR __Date = MAX('Table'[Booked Date])
VAR __MaxDate = __Date - 1
VAR __MinDate = __MaxDate - 7
VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[Booked Date] >= __MinDate && [Booked Date] <= __MaxDate),[Booked Date],"__LRev",SUM('Table'[LRev]))
RETURN
AVERAGEX(__Table,[__LRev])
perfect, that got it! accepted as solution.. thanks so much!
DAX is very new to me.. hopeing it wont take long to pick it up!!
thanks once again for your help!
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 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |