Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Ems800
New Member

Calculating score change year on year

Hi all,

 

I'm going around in circles a little and hoping someone can point me in the right direction as I can't seem to work it out. I'd like to create a new measure/calculated column that calculates the difference between scores year on year. This is for survey data, so will include survey year, theme, theme score, team name etc. Example table below - 

 

Survey yearTeamTheme CodeThemeScore
2021Team AM1Morale5.2
2022Team AM1Morale6.3
2023Team AM1Morale6.1
2021Team BM1Morale5.2
2022Team BM1Morale6.3
2023Team BM1Morale6.1
2021Team AE1Engagement7.7
2022Team AE1Engagement7.8
2023Team AE1Engagement8.0
2021Team BE1Engagement5.4
2022Team BE1Engagement5.3
2023Team BE1Engagement5.7

 

Any pointers would be greatly appreciated!

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @Ems800 

 

You can create measures as follow.

 

2023-2022 = 
VAR _2022 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 2))
VAR _2023 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 1))
RETURN
_2023 - _2022

 

 

 

2022-2021 = 
VAR _2021 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 3))
VAR _2022 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 2))
RETURN
_2022 - _2021

 

 

vxuxinyimsft_0-1705286054689.png

Is this the result you expect?

 

If I've misunderstood you, please provide the result you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community. Or show it as a screenshot. Please remove any sensitive data in advance.

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuxinyi-msft
Community Support
Community Support

Hi @Ems800 

 

You can create measures as follow.

 

2023-2022 = 
VAR _2022 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 2))
VAR _2023 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 1))
RETURN
_2023 - _2022

 

 

 

2022-2021 = 
VAR _2021 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 3))
VAR _2022 = CALCULATE(SUM(survey[Score]), FILTER(survey, survey[Survey year] = YEAR(TODAY()) - 2))
RETURN
_2022 - _2021

 

 

vxuxinyimsft_0-1705286054689.png

Is this the result you expect?

 

If I've misunderstood you, please provide the result you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community. Or show it as a screenshot. Please remove any sensitive data in advance.

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sjoerdvn
Super User
Super User

you can try a measure like this:

Score yoy change = 
VAR pyr = MAX(Survey[Survey year]) -1
RETURN AVERAGE(Survey[Score]) - CALCULATE(AVERAGE(Survey[Score]), Survey[Survey year] = yr)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors