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
Anonymous
Not applicable

4 column average

I have the following information:

measurement 1measurement 2measurement 3measurement 4
342(null)
6542
3542
1235

 

I need PBI to calculate the average across Measurements 1 through 4 

 

I know this is simple but I am new to DAX

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous  ,

Here are the steps you can follow:

1. Create calculated colum.

Average =
var _count=IF([measurement 1]=BLANK(),0,1)+IF([measurement 2]=BLANK(),0,1)+IF([measurement 3]=BLANK(),0,1)+IF([measurement 4]=BLANK(),0,1)
return
([measurement 1]+[measurement 2]+[measurement 3]+[measurement 4])/_count

2. Result

v-yangliu-msft_0-1615868495667.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

5 REPLIES 5
Anonymous
Not applicable

Hi  @Anonymous  ,

Here are the steps you can follow:

1. Create calculated colum.

Average =
var _count=IF([measurement 1]=BLANK(),0,1)+IF([measurement 2]=BLANK(),0,1)+IF([measurement 3]=BLANK(),0,1)+IF([measurement 4]=BLANK(),0,1)
return
([measurement 1]+[measurement 2]+[measurement 3]+[measurement 4])/_count

2. Result

v-yangliu-msft_0-1615868495667.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

worked perfectly. Thanks!

themistoklis
Community Champion
Community Champion

@Anonymous 

 

Can you try any of the following options:

Average = ([Measurement 1] + [Measurement 2] + [Measurement 3] + [Measurement 4]) / 4

Average  = DIVIDE([Measurement 1] + [Measurement 2] + [Measurement 3] + [Measurement 4], 4)

Anonymous
Not applicable

The null value is a 0 so it doesn't work. Any other ideas?

@Anonymous 

Do you mean that you dont want to include in the average the null values. 

For example the first row must be divided by 3 and not 4

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