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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
parzival1220
Frequent Visitor

Calculating Averages & Excluding Blanks

Hi there,

 

Please could I ask for some help creating a measure? I need to create a measure that calculates the average for a set of values in a column. The problem is that some of the values are blank, in Transform these show as 'Error', as it's a calculation of days between two dates and one of the date fields has blanks. The column I'm using (Days to Resolve.Days) was created in Power Query as seen below. No matter what DAX I use I awlays get a syntax error message or that the parameter is not the right type. All I need to do is find the average value excluding blanks. DAX won't allow me to use IF or ISBLANK as it throws an error stating it can't find the column (it only finds my other measures). I'm a bit stuck to be honest 😣. Any hlp would be greatly appreciated. Thanks. 

 

parzival1220_0-1686305135707.png

parzival1220_1-1686305228022.png

 

2 ACCEPTED SOLUTIONS
BIswajit_Das
Solution Supplier
Solution Supplier

Hello @parzival1220  can you share a demo data table with demo values to get better understanding your need.
But here for now you can use

column =

calculate(
average(col1),
filter(tbl_name,col <> blank())
)

View solution in original post

Ahmedx
Super User
Super User

4 REPLIES 4
parzival1220
Frequent Visitor

Thanks @BIswajit_Das & @Ahmedx . That seems to have done the trick! 😀

Ahmedx
Super User
Super User

instead of 0 you can write null

Ahmedx
Super User
Super User

pls try this

Screen Capture #1236.pngScreen Capture #1237.png

BIswajit_Das
Solution Supplier
Solution Supplier

Hello @parzival1220  can you share a demo data table with demo values to get better understanding your need.
But here for now you can use

column =

calculate(
average(col1),
filter(tbl_name,col <> blank())
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.