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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

NaN error

Hello all,

 

I keep getting this NaN error for this statement, and I am not sure why

 

Vol Growth '19-'20 = ('Img Div_Img'[2020 Vol]-'Img Div_Img'[2019 Vol])/'Img Div_Img'[2019 Vol]

 

I am trying to show growth % from 2019 Vol to 2020 Vol by doing 2020 vol minus 2019 vol, then divide that by 2019 vol to get the %

 

 

 

TIA!!

 

 

vol growth.PNG

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

what exactly do you want to do?

For me it looks like these are all calculated columns. Calculated column are statis, that means they are created when the file is loaded and won't change anymore afterwards. For example when you use a slicer, it won't change the content of the column.

 

In your case the new calculated column [Vol Growth '19-'20] will perform the operation line by line once the file is loaded. I'm not really sure if you want that.

Usually you want the whole thing to be interactive. For that you would use a measure. If you create a measure the columns need aggregation. So as a measure you would write:

Vol Growth '19-'20 = ( SUM( 'Img Div_Img'[2020 Vol]) - SUM( 'Img Div_Img'[2019 Vol]) ) / SUM( 'Img Div_Img'[2019 Vol])

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @Anonymous ,

 

what exactly do you want to do?

For me it looks like these are all calculated columns. Calculated column are statis, that means they are created when the file is loaded and won't change anymore afterwards. For example when you use a slicer, it won't change the content of the column.

 

In your case the new calculated column [Vol Growth '19-'20] will perform the operation line by line once the file is loaded. I'm not really sure if you want that.

Usually you want the whole thing to be interactive. For that you would use a measure. If you create a measure the columns need aggregation. So as a measure you would write:

Vol Growth '19-'20 = ( SUM( 'Img Div_Img'[2020 Vol]) - SUM( 'Img Div_Img'[2019 Vol]) ) / SUM( 'Img Div_Img'[2019 Vol])

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
amitchandak
Super User
Super User

@Anonymous , Try

Vol Growth '19-'20 = divide('Img Div_Img'[2020 Vol]-'Img Div_Img'[2019 Vol],'Img Div_Img'[2019 Vol])

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.