I have an original table using which I need to calculate the rolling average of rating table. However I do not get the expected output. Can somebody please help me with a DAX solution for this ?
Please refer the image below:
Any help would be appreciated !
Solved! Go to Solution.
Hi @ketan10
Try this MEASURE
Rolling 2 Days Average = AVERAGEX ( TOPN ( 2, FILTER ( ALL ( TableName[Date] ), TableName[Date] <= SELECTEDVALUE ( TableName[Date] ) ), TableName[Date], DESC ), CALCULATE ( AVERAGE ( TableName[Rating] ) ) )
I replicated your data and chose Average of Rating instead of Sum or Don't summarize etc..
Hi @ketan10
Try this MEASURE
Rolling 2 Days Average = AVERAGEX ( TOPN ( 2, FILTER ( ALL ( TableName[Date] ), TableName[Date] <= SELECTEDVALUE ( TableName[Date] ) ), TableName[Date], DESC ), CALCULATE ( AVERAGE ( TableName[Rating] ) ) )
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
436 | |
194 | |
106 | |
56 | |
49 |
User | Count |
---|---|
468 | |
232 | |
128 | |
75 | |
71 |