Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 @konstee ,
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 @konstee ,
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 @konstee ,
the individual rows are not unique.
Should the value for the Group per year not be unique?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |