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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Can someone please help me how to calculate average value when we have null values in the data.

Please find below the data source screenshot.

 

I have to calculate average of all columns. Please do help me. Thanks.

 

when i do using AveageA function as below, i am getting an error.

 

Average value = AVERAGEA('Booked Time'[W/c 03-09-2018]+'Booked Time'[W/c 10-09-2018]+'Booked Time'[W/c 20-08-2018]+'Booked Time'[W/c 27-08-2018])

 

data screenshot.PNG

 

3 ACCEPTED SOLUTIONS

Have a look at my Multi-Column Aggregations (MC Aggregations) Quick Measure. This is DAX.

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-yuta-msft
Community Support
Community Support

Hi karthiksunku,

 

You can create a calculate column to calculate the sum of the four columns then use AVERAGE() function to achieve the result of that calculate column.

 

Regards,

Jimmy Tao 

View solution in original post

ofirk
Resolver II
Resolver II

Hi, I'm not sure if I understand correctly: you're trying to calculate the average of the values in the four columns, not the average of each column separately, right?


This isn't very elegant, but I expect it will work:

 

Average value = (IF(NOT ISBLANK([W/c 03-09-2018]), [W/c 03-09-2018]) + IF(NOT ISBLANK([W/c 10-09-2018]), [W/c 10-09-2018]) + IF(NOT ISBLANK([W/c 20-08-2018]), [W/c 20-08-2018]) + IF(NOT ISBLANK([W/c 27-08-2018]), [W/c 27-08-2018])) / (IF(NOT ISBLANK([W/c 03-09-2018]), 1) + IF(NOT ISBLANK([W/c 10-09-2018]), 1) + IF(NOT ISBLANK([W/c 20-08-2018]), 1) + IF(NOT ISBLANK([W/c 27-08-2018]), 1))

View solution in original post

5 REPLIES 5
ofirk
Resolver II
Resolver II

Hi, I'm not sure if I understand correctly: you're trying to calculate the average of the values in the four columns, not the average of each column separately, right?


This isn't very elegant, but I expect it will work:

 

Average value = (IF(NOT ISBLANK([W/c 03-09-2018]), [W/c 03-09-2018]) + IF(NOT ISBLANK([W/c 10-09-2018]), [W/c 10-09-2018]) + IF(NOT ISBLANK([W/c 20-08-2018]), [W/c 20-08-2018]) + IF(NOT ISBLANK([W/c 27-08-2018]), [W/c 27-08-2018])) / (IF(NOT ISBLANK([W/c 03-09-2018]), 1) + IF(NOT ISBLANK([W/c 10-09-2018]), 1) + IF(NOT ISBLANK([W/c 20-08-2018]), 1) + IF(NOT ISBLANK([W/c 27-08-2018]), 1))

v-yuta-msft
Community Support
Community Support

Hi karthiksunku,

 

You can create a calculate column to calculate the sum of the four columns then use AVERAGE() function to achieve the result of that calculate column.

 

Regards,

Jimmy Tao 

Greg_Deckler
Super User
Super User

Are you trying to use AVERAGEA in the Query Editor? Because that is not going to work. AVERAGEA is DAX and Query Editor is M.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler,

 

Actually i want to try it creating calculated column or measure but fed up of it getting error and asking in the community.

 

Please help me if you have any idea on doing it using DAX or M Query.

 

Thanks in advance !!

Have a look at my Multi-Column Aggregations (MC Aggregations) Quick Measure. This is DAX.

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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