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.
Hello!
My target is to create a new column, which shall contain the value of the previous year and group.
Any ideas?
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Enter Power Query through Transform data, Add column -From 1.
2. Create calculated column.
rankx = RANKX(FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])),'Table'[Index],,ASC)
Average in Last Year =
CALCULATE(SUM('Table'[Average in Year]),FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])-1&&'Table'[rankx]=EARLIER('Table'[rankx])))
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
Here are the steps you can follow:
1. Enter Power Query through Transform data, Add column -From 1.
2. Create calculated column.
rankx = RANKX(FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])),'Table'[Index],,ASC)
Average in Last Year =
CALCULATE(SUM('Table'[Average in Year]),FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])-1&&'Table'[rankx]=EARLIER('Table'[rankx])))
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
the individual rows are not unique.
Should the value for the Group per year not be unique?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.