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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pvravestein
Helper I
Helper I

Divide multiple columns averages in total average considering also blanks

I calculate averages in my table and also I want a Total average from those averages.

But sometime I have no value, then then total average must give the total average from the other averages without the blank. 

Below is an example where you see an Total average of 1.6 (8+0+0+0+0/5 = 1.6).

But I want this Total number to be 8 (8+0+0+0+0/1).

What to do?

pvravestein_0-1610550178836.png

Thanks

3 REPLIES 3
AnkitKukreja
Super User
Super User

Hi @pvravestein 

 

You can follow the below approach as well:

Unvpivot your columns in Power Query or you can create new table using the below dax.


Avg_Data =
UNION(
    SELECTCOLUMNS( 'Average_Data' , "A" , "A" , "AvgData" , 'Average_Data'[A] ),
    SELECTCOLUMNS( 'Average_Data' , "B" , "B" , "AvgData" , 'Average_Data'[B] ),
    SELECTCOLUMNS( 'Average_Data' , "C" , "C" , "AvgData" , 'Average_Data'[C] ),
    SELECTCOLUMNS( 'Average_Data' , "D" , "D" , "AvgData" , 'Average_Data'[D] ),
    SELECTCOLUMNS( 'Average_Data' , "E" , "E" , "AvgData" , 'Average_Data'[E] )
    )
And post that just simply use AVERAGE( Table[E] ) and you will get the desired result as average ignores the blank values.


 
For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904
amitchandak
Super User
Super User

@pvravestein , Try like

averagex(filter(Table, Table[Col1]<> 0 && not(isblank(Table[Col1]))),[Table[Col1]])

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

Great, thanks.  But forgive me, I am new to DAX and I cannot get it to work.

My table name is change, column names are on top of my screenshot. What will it look like with all data?

Many thanks

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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