Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I want to accumulte the but as ans average, so : { 1, 1, 1 ,1} = 1 / 1 , 2 /2 , 3/3 , 4/ 4
so here the average is calculated in select;
let
alist =
let
alist = List.Numbers(1, 12, 1)
in
alist,
result = List.Generate(
() => [x = 0, y = alist{0}, z = y / (x + 1)],
each [x] < List.Count(alist),
each [x = [x] + 1, y = alist{x}, z = [z] + y],
each [z] / ([x] + 1)
)
in
result
but can i get the average in the function, i have tried various such as ;
= List.Generate
()=> [ x = 1 , y = alist {0} , z = y / x ] ,
each [x] < List.Count( alist ),
each [ x = [x] + 1, y = alist {x} , z = List.Sum( { [z], y} ) / x ],
each [z] )
i have played around with various x = 0 , x = 1 etc. but cannot get one to work?
Not sure what you want for a result.
What result would you like to see for your List.Numbers(1,12,1) list?
Your code gives the average where for each row n, the average of values alist{0..n}
Perhaps if you gave an example other than {1,1,1,1}??
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Check out the July 2026 Power BI update to learn about new features.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.