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.
Hi,
I am trying to generate a new column based on two other columns, and not able to get this to work.
Item1 1/1/21 8
Item1 1/1/21 8
Item1 1/1/21 8
Item1 1/2/21 9
Item1 1/2/21 9
Item2 1/1/21 10
Item2 1/1/21 10
Item2 1/2/21 8
Item2 1/2/21 8
Desired Output:
Item1 1/1/21 8
Item1 1/1/21 0
Item1 1/1/21 0
Item1 1/2/21 9
Item1 1/2/21 0
Item2 1/1/21 10
Item2 1/1/21 0
Item2 1/2/21 8
Item2 1/2/21 0
Basically, a new column should show the average of the number per item per date in one column and the other columns as 0 for the remaining rows for the same item and date.
Hope my question is not confusing.
Solved! Go to Solution.
@BB9 , first you need to add an index in the power query.
Then a new column
new column =
var _min = minx(filter(Table, [item] = earlier([item]) && [date] = earlier([date])),[Index])
var _avg = minx(filter(Table, [item] = earlier([item]) && [date] = earlier([date])),[value])
return
if([Index] =_min, _avg, blank())
@BB9 , first you need to add an index in the power query.
Then a new column
new column =
var _min = minx(filter(Table, [item] = earlier([item]) && [date] = earlier([date])),[Index])
var _avg = minx(filter(Table, [item] = earlier([item]) && [date] = earlier([date])),[value])
return
if([Index] =_min, _avg, blank())
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.