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
Dear Community,
How can I count a kind of a moving averge that works likes this: First date is fixed and the average is counted on adding every next date's data as it procceeds. For example:
I have Date
|
So, now the aevarge is counted like this in excel: IF(AND(A1<>"",C1<>"-"),ROUND(AVERAGE($E$1:E1),1),"-") .
The part that confuses me is that fixing the first value and calculateing the average of that fixed value plus every next one as it goes.
Thank you for your help!
Solved! Go to Solution.
Hi @Anonymous ,
Please try the following measure:
Moving Average =
VAR FirstID = FIRSTNONBLANKVALUE ( 'Table'[Date], MAX ( 'Table'[ID] ) )
VAR firstWeight = FIRSTNONBLANKVALUE ( 'Table'[Date], SUM ( 'Table'[Weights] ) )
VAR Ave =
CALCULATE (
AVERAGE ( 'Table'[Weight / pack] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
)
RETURN
IF ( AND ( FirstID <> BLANK (), ISNUMBER ( firstWeight ) ), Ave, "-" )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try the following measure:
Moving Average =
VAR FirstID = FIRSTNONBLANKVALUE ( 'Table'[Date], MAX ( 'Table'[ID] ) )
VAR firstWeight = FIRSTNONBLANKVALUE ( 'Table'[Date], SUM ( 'Table'[Weights] ) )
VAR Ave =
CALCULATE (
AVERAGE ( 'Table'[Weight / pack] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
)
RETURN
IF ( AND ( FirstID <> BLANK (), ISNUMBER ( firstWeight ) ), Ave, "-" )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 10 |