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.
Hi,
I have this table
I need a Calculated Column in another table wich has Unique Branch values. This Column needs to show the average of the last 2 yeas ( Average of the SUM of score for each team based on year 3 and 4)
Thanks for your help!
Solved! Go to Solution.
Hi @Anonymous ,
We can create a calculate column to meet your requirement.
Column =
VAR _max =
CALCULATE (
MAX ( 'Table'[Year] ),
FILTER ( 'Table', 'Table'[Branch] = 'Table (2)'[Branch] )
)
VAR _min = _max - 1
VAR _sum_max =
CALCULATE (
SUM ( 'Table'[Score] ),
FILTER (
'Table',
'Table'[Year] = _max
&& 'Table'[Branch] = 'Table (2)'[Branch]
)
)
VAR _sum_min =
CALCULATE (
SUM ( 'Table'[Score] ),
FILTER (
'Table',
'Table'[Year] = _min
&& 'Table'[Branch] = 'Table (2)'[Branch]
)
)
RETURN
DIVIDE ( _sum_max + _sum_min, 2 )
If you have any question, please kindly ask here and we will try to resolve it.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?
If you've fixed the issue on your own please kindly share your solution.
If the above posts help, please kindly mark it as a solution to help others find it more quickly. Thanks!
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can create a calculate column to meet your requirement.
Column =
VAR _max =
CALCULATE (
MAX ( 'Table'[Year] ),
FILTER ( 'Table', 'Table'[Branch] = 'Table (2)'[Branch] )
)
VAR _min = _max - 1
VAR _sum_max =
CALCULATE (
SUM ( 'Table'[Score] ),
FILTER (
'Table',
'Table'[Year] = _max
&& 'Table'[Branch] = 'Table (2)'[Branch]
)
)
VAR _sum_min =
CALCULATE (
SUM ( 'Table'[Score] ),
FILTER (
'Table',
'Table'[Year] = _min
&& 'Table'[Branch] = 'Table (2)'[Branch]
)
)
RETURN
DIVIDE ( _sum_max + _sum_min, 2 )
If you have any question, please kindly ask here and we will try to resolve it.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
please try this
newtable =
VAR maxyear=max('Table (2)'[year])
return SUMMARIZE(FILTER('Table (2)','Table (2)'[year]>=maxyear-1),'Table (2)'[branch],"AVG",AVERAGE('Table (2)'[score]))
Proud to be a Super User!
Hi,
Why do you need a calculated column formula? Why not a measure in a Table visual?
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |