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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

% Difference Between Average Measures

Hello,

I've been reviewing posts on % Differences and haven't been able to find one that is similar to my situation.

 

I have one Queury that contains 2019 and 2020 data. I'd like to find the % Difference between the average of a user defined time frame from 2019 compared to the same time frame from 2020.

 

For example, I'd like to take % Difference of the average of the entries in January, February, March of 2019 of the Lane Clearance Duration column below and the average of the entries of the January, February, March of 2020 of the same column. I'd like to be able to choose the time frame on a more user defined basis, say comparing the same month, or quarter, or year.

 

sltraffic_0-1608750579498.png

 

Let me know if you need any additional information.

 

Thanks in advance.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Anonymous  Do these two queries both have the same columns? All the percent difference calcuations work on one column, so this will be easier if you append both queries into one table. 

 

https://docs.microsoft.com/en-us/power-query/append-queries

 

Then you'll need a data table to be able to use time intelligence: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

 

Finally, create your base measure, for example:

 

Average Duration = AVERAGE(AppendedTable[Event Duration])

 

Then use DATEADD to create the Previous year measure:

PY Average Duration = CALCULATE( [Average Duration], DATEADD(Date[Date], -12, Month) )

 

Finally % Diff is: 

YoY Percent Change Average Duration = DIVIDE( [Average Duration] - [PY Average Duration] , [PY Average Duration] )

 

Then put all measures in a visual with Year, Quarter, Month from your Date table and let users decide which level they want to see. 

 

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

@Anonymous  Do these two queries both have the same columns? All the percent difference calcuations work on one column, so this will be easier if you append both queries into one table. 

 

https://docs.microsoft.com/en-us/power-query/append-queries

 

Then you'll need a data table to be able to use time intelligence: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

 

Finally, create your base measure, for example:

 

Average Duration = AVERAGE(AppendedTable[Event Duration])

 

Then use DATEADD to create the Previous year measure:

PY Average Duration = CALCULATE( [Average Duration], DATEADD(Date[Date], -12, Month) )

 

Finally % Diff is: 

YoY Percent Change Average Duration = DIVIDE( [Average Duration] - [PY Average Duration] , [PY Average Duration] )

 

Then put all measures in a visual with Year, Quarter, Month from your Date table and let users decide which level they want to see. 

 

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors