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

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

Reply
jinsbi
New Member

Filter out NaN values in column

Hi All,

I have a column called "Value" in my PBI file,  which is of Decimal Number type by default also containing "NaN".  "NaN" came directly from the source file.  So it causes my DAX function to display NaN. Is there any way to avoid it? ( Without replacing NaN to 0). 

my DAX is 

Energy export = CALCULATE(sum(Turbine_Data[Value]),FILTER(Turbine_Data,Turbine_Data[Signal]="Energy Export (kWh)"))

 

jinsbi_0-1644472449276.png

 

jinsbi_1-1644472563465.png

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @jinsbi 

I think you need to remove NaN at row level to avoid erros in your calculation. Try:

Energy export =
CALCULATE (
    SUMX ( Turbine_Data, IF ( Turbine_Data[Value] > 0, Turbine_Data[Value] ) ),
    Turbine_Data[Signal] = "Energy Export (kWh)"
)

Please let me know if solved your problem. If so, kindly mark my reply as accepted solution. Thank you!

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @jinsbi 

I think you need to remove NaN at row level to avoid erros in your calculation. Try:

Energy export =
CALCULATE (
    SUMX ( Turbine_Data, IF ( Turbine_Data[Value] > 0, Turbine_Data[Value] ) ),
    Turbine_Data[Signal] = "Energy Export (kWh)"
)

Please let me know if solved your problem. If so, kindly mark my reply as accepted solution. Thank you!

amitchandak
Super User
Super User

@jinsbi ,

Energy export = iferror( CALCULATE(sum(Turbine_Data[Value]),FILTER(Turbine_Data,Turbine_Data[Signal]="Energy Export (kWh)")),0)

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

Thanks for the response.It helps to replace NaN with 0. But it makes total calculated as 0 instead of 3400653.00

jinsbi_0-1644477314312.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.