cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sreetejreddy
Helper I
Helper I

How to replace NaN with 0 in "Financial Reporting Matrix by Profitbase" visualization

Hi,

 

I am using "Financial Reporting Matrix by Profitbase" visualization, sole purpose of it is to have row level calculation.

 

Issue: I created a calculated row a3 = a2 / a1, when a1 and a2 are 0s or a1 is 0, the output of a3 is NaN.

Account  |  Amount

a1           |      0

a2           |      0

a3           |      NaN

 

Please suggest on how to replace this NaN or suggest some other visualiztions to work with that would suffice the above scenario.

 

Warm Regards,

Sreetej

1 ACCEPTED SOLUTION
Eyelyn9
Community Support
Community Support

Hi @sreetejreddy ,

Please try to use the following formula:

Measure =
IFERROR ( MAX ( 'Table'[A1] ) / MAX ( 'Table'[A2] ), 0 ) + 0

10.29.1.1.PNG

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

View solution in original post

4 REPLIES 4
Eyelyn9
Community Support
Community Support

Hi @sreetejreddy ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,
Eyelyn Qin

Eyelyn9
Community Support
Community Support

Hi @sreetejreddy ,

Please try to use the following formula:

Measure =
IFERROR ( MAX ( 'Table'[A1] ) / MAX ( 'Table'[A2] ), 0 ) + 0

10.29.1.1.PNG

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

 

Best Regards,
Eyelyn Qin

View solution in original post

Eyelyn9
Community Support
Community Support

Hi @sreetejreddy ,

According to the official documentWe recommend that you use the DIVIDE function  whenever the denominator is an expression that could return zero or BLANK.

 

And if you want to  return an alternate value—— 0, you could use IF( ) function as belows:

useDivide =
VAR _value =
    DIVIDE ( MAX ( 'Table'[A1] ), MAX ( 'Table'[A2] ) )
RETURN
    IF ( _value = BLANK (), 0, _value )

10.22.4.1.PNG

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

Best Regards,
Eyelyn Qin

Hi Eyelyn,

 

We are using "Financial Reporting Matrix by Profitbase" visualization.

 

This does not have an option to use any functions like divide. We can only use +, -, *, /.

 

Thanks,

Sreetej

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors