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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RMDNA
Solution Sage
Solution Sage

Infinity, NaN, and divide function

All,

 

In a custom column, I'm attempting to divide two columns, [Committed] and [Actual] (fixed decimal numbers in the backend, as U.S. Currency), and attempting to get a [% to target] result. The end goal is to filter by these categories:

 

a. commited for $0, spent $0

b. commited for $0, spent >$0

c. committed >$0, spent $0

d. commited for $x, spent $y

 

Trying to divide, either by [A]/[B] or DIVIDE( ), I'm getting a mix of actual zeroes, NaNs, and infinities, and I haven't been able to use conditional columns or if/then statements to group them. Any help?

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @RMDNA,

 

In my opinion, it should be three categories, as both a. and c. have the numerator 0 which can be treated as the same scenario. Based on my tested, use DIVIDE() function, it returns three kind of values, blank, zero and actual decimal.

 

q4.PNG

 

If the above is not your required results, please share some sample data and screenshots about desired results for our analysis.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks. I also have the same issue. It's solved.

Greg_Deckler
Super User
Super User

Can you post some sample data? Generally, if zeros are involved, use DIVIDE to avoid divide by zero errors. Additionally, use the erd parameter "alternateresult" option of the DIVIDE function to catch divide by zero and return what you want. Potentially wrap it all in an IF statement if necessary.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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