Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi, I have a similar problem to the following:
The biggest difference that I could not figure out, is that i want the average to be for every value before the current row (whereas in the above example, it is for a 30-day timeframe).
Thank you
Solved! Go to Solution.
@aar0n ,
You need to add an index column and then create a calculate column using DAX like pattern below:
AverageCol =
CALCULATE (
AVERAGE ( TableA[SALES] ),
FILTER (
TableA,
TableA[SKU] = EARLIER ( TableA[SKU] )
&& TableA[Index] <= EARLIER ( TableA[Index] )
)
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@aar0n ,
You need to add an index column and then create a calculate column using DAX like pattern below:
AverageCol =
CALCULATE (
AVERAGE ( TableA[SALES] ),
FILTER (
TableA,
TableA[SKU] = EARLIER ( TableA[SKU] )
&& TableA[Index] <= EARLIER ( TableA[Index] )
)
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
93 | |
83 | |
77 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |