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! Learn more

Reply
jeremy-b
Regular Visitor

Average and standard deviation

Hi everyone,

I would like to calculate a 2-year average and standard deviation with the following information:

 

DivisionNotificationCreated on
A0045828702/01/2020
B0045828802/01/2020
A0045828903/01/2020
B0045829003/01/2020
B0045829103/02/2020
A0045829203/02/2020
B0045829303/03/2020
C0045829403/05/2020
B0045829504/05/2020
C0045829605/05/2020
C0045829706/06/2020
A0045829806/06/2020
A0045829906/06/2020
C0045830006/07/2020
C0045830107/07/2021
C0045830231/01/2021
C0045830331/01/2021
C0045830431/01/2021
B0045830502/02/2021
C0045830602/02/2021
B0045830702/02/2021
A0045830802/02/2021
B0045830916/03/2021
A0045831016/03/2021
A0045831116/03/2021
C0045831216/03/2021
A0045831316/03/2021
B0045831408/04/2021
A0045831509/04/2021
C0045831609/04/2021
B0045831709/04/2021

With a dynamic pivot table I can do it but I want to do it in Power BI.

2022-07-13 10_12_01-Classeur2.xlsx - Excel.png

thank you for your help.

4 REPLIES 4
amitchandak
Super User
Super User

@jeremy-b , If you need each row consider 12 months you can have measure like

 

Rolling 12 = CALCULATE(Average(Table[valuet]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))

 

I do not see any value column, avg of ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, @amitchandak 

thank you for your help.

 

to answer your question, I don't have any values because I need to first count the number of "notifications" per month and then calculate the average of this number.

 

I need to calculate the average per line (e.g: 2020 and 2021)

 

 

@jeremy-b , For Avg of Count/Sum

 

A measure like

 

averageX(Values('Date'[Month Year]), calculate(count(Table[Value])) )

 

This will work for Sub total and GT

 

Each row year wise Avg

averageX(Values('Date'[Month Year]), calculate(count(Table[Value])) )

 

This Year = CALCULATE(averageX(Values('Date'[Month Year]), calculate(count(Table[Value])) ),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))

 

Last Year = CALCULATE(averageX(Values('Date'[Month Year]), calculate(count(Table[Value])) ),filter(ALL('Date'),'Date'[Year]=max('Date'[Year]) -1 ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak hi,

 

for my understanding, to use these measures I need to create a date table ?

 

There are errors in the average calculations, because there may be a month with no value.
For example, I have 11 notifications (January to November) for one year, but there are no notifications in December.

The average is calculated on the 11 values whereas there are 12 months. The last value in December should be counted as 0.

 

 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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