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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
So im really having a hard time with making an average of the last 10 values excluding the blanks. the average must take into consideration that the blanks inbetween the values are inconsistent. I hope you get the picture. I used the command below but it only copied the values instead of averaging them:
Before, I used to edit the formula bar each week in Excel to update the values so it would only average the last 10 values like this:
If anyone could help out that would be great!
thank you
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
I tried to create a sample pbix file like the attached file.
Last 10 CZV avg measure: =
VAR newtable =
TOPN (
10,
FILTER ( ALL ( Data ), NOT ISBLANK ( Data[CZV] ) ),
Data[Date], DESC
)
RETURN
IF (
SELECTEDVALUE ( Data[Date] ) >= MINX ( newtable, Data[Date] )
&& SELECTEDVALUE ( Data[Date] ) <= MAXX ( newtable, Data[Date] )
&& NOT ISBLANK ( [CZV total measure:] ),
AVERAGEX ( newtable, Data[CZV] )
)
Hi,
Please check the below picture and the attached pbix file.
I tried to create a sample pbix file like the attached file.
Last 10 CZV avg measure: =
VAR newtable =
TOPN (
10,
FILTER ( ALL ( Data ), NOT ISBLANK ( Data[CZV] ) ),
Data[Date], DESC
)
RETURN
IF (
SELECTEDVALUE ( Data[Date] ) >= MINX ( newtable, Data[Date] )
&& SELECTEDVALUE ( Data[Date] ) <= MAXX ( newtable, Data[Date] )
&& NOT ISBLANK ( [CZV total measure:] ),
AVERAGEX ( newtable, Data[CZV] )
)
Thanks a bunch! this worked for me.
Try replacing VALUES ( 'afvalwater CPL'[Datum] ) with ALLSELECTED ( 'afvalwater CPL'[Datum] )
This didnt work. gave me duplicate values instead. thank you tho!
Check out the November 2025 Fabric 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!