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,
I need count in column Table2[Last7d] average Table[TotalProduct] value of the last 7 days ofr each employee.
I was looking solution on similar topics, but i didn't find it.
How does it look in DAX?
I tried: Last7d = CALCULATE(
AVERAGE(
Table1[TotalProduct]),
DATESINPERIOD(Table1[Date],
LASTDATE(Table1[Date]),-7,DAY))
but i have only results 1 and 0.
Where did I make mistake ?
Solved! Go to Solution.
@arveseba wrote:
Hi,
I need count in column Table2[Last7d] average Table[TotalProduct] value of the last 7 days ofr each employee.
I was looking solution on similar topics, but i didn't find it.
How does it look in DAX?
I tried: Last7d = CALCULATE(
AVERAGE(
Table1[TotalProduct]),
DATESINPERIOD(Table1[Date],
LASTDATE(Table1[Date]),-7,DAY))
but i have only results 1 and 0.
Where did I make mistake ?
For those functions DATEINPERIOD, LASTDATE, PREVIOUSMONTH etc, please use a consecutive calendar table. Then change the measure a little bit. The attached demo is for your reference.
Last7d = CALCULATE ( AVERAGE ( Table1[TotalProduct] ), DATESINPERIOD ( DateTable[Date], LASTDATE ( DateTable[Date] ), -7, DAY ) )
@arveseba wrote:
Hi,
I need count in column Table2[Last7d] average Table[TotalProduct] value of the last 7 days ofr each employee.
I was looking solution on similar topics, but i didn't find it.
How does it look in DAX?
I tried: Last7d = CALCULATE(
AVERAGE(
Table1[TotalProduct]),
DATESINPERIOD(Table1[Date],
LASTDATE(Table1[Date]),-7,DAY))
but i have only results 1 and 0.
Where did I make mistake ?
For those functions DATEINPERIOD, LASTDATE, PREVIOUSMONTH etc, please use a consecutive calendar table. Then change the measure a little bit. The attached demo is for your reference.
Last7d = CALCULATE ( AVERAGE ( Table1[TotalProduct] ), DATESINPERIOD ( DateTable[Date], LASTDATE ( DateTable[Date] ), -7, DAY ) )
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |