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
madmanmark198
Frequent Visitor

Avg Gift measure replace NaN

Really easy one I am sure but any help on this would be greatly appriciated.  I have a basic measure calculating average gift based off 2 other mesaures:

 

Avg Gift = [Received + Balance] / [Distinctcount Donors]
 
Some of the rows in my table have no data yet so I have £0 for Recieved + Balance  and 0 Distinct Donors.  All works fine when there is data but for those rows where there isnt any data yet it returns a NaN.  What I would like it to do is to show 0 or n/a in place of Nan?
 
 
1 ACCEPTED SOLUTION
rajulshah
Super User
Super User

@madmanmark198 

You can use the following DAX measure:

Avg Gift = DIVIDE([Received + Balance],[Distinctcount Donors],0)

Please let me know if this didn't work. 

View solution in original post

2 REPLIES 2
rajulshah
Super User
Super User

@madmanmark198 

You can use the following DAX measure:

Avg Gift = DIVIDE([Received + Balance],[Distinctcount Donors],0)

Please let me know if this didn't work. 

Brillaint thank you so much!  Nice and easy!  Sometimes it just takes another set of eyes to figure it out.

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.