Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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] ) )
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |