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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Nan and Infinity In Divide function

Hi,

 

I have a growth calulated measure but the values are coming as nan and Infinity

 

below is the sample data 

The dax to calulate is 

#YOYClientGrowth1 = ([#Sum_ActualRevenue] - [#Gross Revenue Prior Year])/([#Gross Revenue Prior Year])
 
Now I need to put condition in the "#YOYClientGrowth1" for blank and 0 values
 
 Blank and Blank as 0
Current value and Previous Blank then 1
Current Blank and Previous value result -1
 
 

 

NanInfinityError.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

You are getting NAN and Infinity because you are dividing 0 by 0 and 747 by blank ( where blanks it considers as zero)..

 

You will have to change your formula.

 

or you can try creating 2 quick measures. 

- 1st measure for subtraction SUM and Gross Revenue

- 2nd to divide the above measure with Gross Revenue.

 

Add in table to get somehting like this.

 

Capture 16.PNG

Let me know if this helps . 

 

Thanks,

Tejaswi

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

use the DIVIDE function instead of  "/"

This should be the solution!

Anonymous
Not applicable

Hi @Anonymous 

 

You are getting NAN and Infinity because you are dividing 0 by 0 and 747 by blank ( where blanks it considers as zero)..

 

You will have to change your formula.

 

or you can try creating 2 quick measures. 

- 1st measure for subtraction SUM and Gross Revenue

- 2nd to divide the above measure with Gross Revenue.

 

Add in table to get somehting like this.

 

Capture 16.PNG

Let me know if this helps . 

 

Thanks,

Tejaswi

 

 

Anonymous
Not applicable

It worked with the Divide. Thanks

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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