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
Anonymous
Not applicable

Measure

Hi Guys,

 

Please refer the below screenshot.

 

I've created a measure for my model and don't understand what these NaN is coming in my visual.

Can anybody suggest me what is this.

 

Measure:

Average Weighted Term Length (MWh) = CALCULATE(SUM(View_DealClosing[Weighted Calc])/SUM(View_DealClosing[Term Usage (MWh)]))
 

Regards,

Himanshu

 

 

Himanshu_13_0-1609750315310.png

Idealy 0/0 should be 0 but dont understand what is this NaN.

 

 

 

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

The NaN error occurs when you are dividing 0 by 0, in your case you can use a divide funciton with the additional parameter to your divide function to return whatever value you want in this case maybe 0 so redo your measure to:

 

Average Weighted Term Length (MWh) =
DIVIDE (
    SUM ( View_DealClosing[Weighted Calc] ),
    SUM ( View_DealClosing[Term Usage (MWh)] ),
    0
)

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous ,

 

The NaN error occurs when you are dividing 0 by 0, in your case you can use a divide funciton with the additional parameter to your divide function to return whatever value you want in this case maybe 0 so redo your measure to:

 

Average Weighted Term Length (MWh) =
DIVIDE (
    SUM ( View_DealClosing[Weighted Calc] ),
    SUM ( View_DealClosing[Term Usage (MWh)] ),
    0
)

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks for the help !!!

 

It resolved my issue.

 

Regards,

Himanshu

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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