Forum Discussion

yogita's avatar
yogita
Frequent Visitor
3 years ago

YoY Change %

I am trying to write a measure and use it in a matrix that does two thing:

1. Show average values  for a data point.

2. Claculate YoY % change of level above it. 

I have an hierachy built as below. I nee to show Average values for Employee Name / Trade code and then show YoY Change % for all the above data fields. 

 I am not sure why the YoY Change % will not come out correct afor the top 3 levels. I am using this measure. 

Billing Rate = Var _BR =Average(ProjectRateEscalation[BillingRate])
RETURN
if(ISINSCOPE(ProjectRateEscalation[Employee Name / Trade code]),_BR,
   if(ISINSCOPE(ProjectRateEscalation[JobCode]),[YOY Change %],
        if(ISINSCOPE(ProjectRateEscalation[control_job]),[YOY Change %],
            if(ISINSCOPE(ProjectRateEscalation[OfficeCode]),[YOY Change %]))))
 
YOY Change % = Var PY = CALCULATE(AVERAGE(ProjectRateEscalation[BillingRate]),DATEADD('Table'[Date],-1,YEAR) )
                    Return  DIVIDE(AVERAGE(ProjectRateEscalation[BillingRate])-PY,AVERAGE(ProjectRateEscalation[BillingRate]))
 
I am not sure why this measure would just not work. Can somebody please share some insight? 
Below is the sample data :
 
EmployeeNumberTradeCodeTradeCodeDescEffectiveDateCharging RateEmployee Name / Trade codeControl JobYearJobCodecontrol_jobOfficeCode
111  2/25/202379 ABCD1232023B22023-BODB22023-001B
112  2/25/2023165 ABCD1242023B22023-BODB22023-001B
113  2/25/2023235 ABCD1252023B23005-GRB23005-001B
114  2/25/2023110 ABCD1262023B23005-GCB23005-001B
115  2/25/2023146 ABCD1272023B23005-ZNRB23005-001B
116  2/25/2023174 ABCD1282023B23005-GCB23005-001B
117GR3CGroup 3 Laborers - Con - Union1/1/2024110Group 3 Laborers - Con - UnionABCD1292024B19022-GRB19022-001B
118G3FCGroup 3 Labor Foremn - Con - U1/2/2024125Group 3 Labor Foremn - Con - UABCD1302024B19022-GRB19022-001B
11970C70% Appr Carp - Con - U1/2/202411970% Appr Carp - Con - UABCD1312024B19022-XCCB19022-XCC1B
120  1/1/2024167 ABCD1322024B19022-XDDB19022-XDD1B
121  1/2/202584 ABCD1332025B19034-GCAB19034-001B
122  1/2/2025118 ABCD1342025B19034-GCAB19034-001B
123  1/2/2025122 ABCD1352025B19034-GCAB19034-001B
124DWA3Drywall- Appr- Level 3 - Non U12/24/2022150Drywall- Appr- Level 3 - Non UABCD1362022A23999-99A23999-004A
125DRYADRYWALL APPRENTICE12/24/202278DRYWALL APPRENTICEABCD1372022A23999-99A23999-004A
126DRY1DRYWALLER NON UNION12/24/2022236DRYWALLER NON UNIONABCD1382022A23999-99A23999-004A
127CLTUCrew Lead - Taper - Union12/24/2022123Crew Lead - Taper - UnionABCD1392023A23999-99A23999-004A
128CLTNCrew Lead - Taper - Non Union12/24/2022124Crew Lead - Taper - Non UnionABCD1402023A23999-99A23999-004A
129CLLNCrew Lead- Laborer- GC - Non U12/24/2022212Crew Lead- Laborer- GC - Non UABCD1412024A23999-99A23999-004A
130CLLCUCrew Lead - Laborer - Con - U12/24/2022180Crew Lead - Laborer - Con - UABCD1422025A23999-99A23999-004A
 
 
 

1 Reply

  • Your sample data is a bit too sparse for a meaningful answer. But here is the general approach for a YoY% (without a proper Dates table)