NaN in SSRS Pie Chart Legend

I have a Pie Chart report that works well until Users discovered that when values are 0% or less across the chart, the Legend returns NaN. How do I format the Legend to return 0% instead of the NaN that Users do not want to see. Below is my express for the Legend Property

="#AXISLABEL" & " - " & "#PERCENT{P0}"

Tha

September 1st, 2015 6:40am

Use this

=replace("#AXISLABEL" & " - " & "#PERCENT{P0}","NaN","0")+"%"

Or if the above is not working then try using ISNOTHING

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 7:02am

Thanks Milan.

From the first expression above, I "NaN%" returned back and when I tried with ISNOTHING, I got an error as the expression was not well formatted. My expression:

=isNothing("#AXISLABEL" & " - " & "#PERCENT{P0}","NaN","0")+"%"

September 1st, 2015 7:14am

Try this

=isNothing(("#AXISLABEL" & " - " & "#PERCENT{P0}"),0)

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 8:07am

Try this

=isNothing(("#AXISLABEL" & " - " & "#PERCENT{P0}"),0)		
September 1st, 2015 9:03am

Hi Zionlite, 

According to your description, you want to return 0% value if the values are 0% or less across the chart, right? 

In Reporting Services, we can use IIf() function to return the required result based on the condition. For you requirement, please refer to the following expression: 

=IIf(Fields!value.value > 0, "#AXISLABEL" & " - " & "#PERCENT{P0}", "0%")

If you have any other question, please feel free to ask. 

Regards,
Shrek Li

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 10:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics