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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dkdirenzo
Frequent Visitor

Divide Numerator by Denominator - Row Level

Hi, would anyone be able to assist with the measure to divide the Yield(Numerator) by the Volume for each asset class? I've created 2 measures for each but when I divide to get to the yield, I'm getting an "NaN" or 0 value. I believe the complexity is because yield and volume is at the row level? *please note denominator figures are in millions

dkdirenzo_0-1715106575971.png

 

2 ACCEPTED SOLUTIONS
ExcelMonke
Solution Supplier
Solution Supplier

I think the issue is that you can't divide by zero ... 🤠 
Assuming your numerator and denominator values are "normal" (i.e. not a result of a complex measure), and in a number format, dividing the two should not kick back any errors. 

View solution in original post

v-huijiey-msft
Community Support
Community Support

Hi @dkdirenzo ,

 

Thanks for the reply from ScottShearer and ExcelMonke .

 

Use the Divide function for division instead of “/”.

 

I have the same problem as you when I use “/”.

vhuijieymsft_0-1715149695551.png

 

For more information about the Divide function see:

vhuijieymsft_1-1715149695552.png

DIVIDE function (DAX) - DAX | Microsoft Learn

 

Can you try this Measure below:

Measure = DIVIDE(MAX('Table'[Denominator]), MAX('Table'[Numerator]),0)

 

I noticed in your screenshot that either the numerator is 0 or the denominator is 0 .

 

0 divided by any number is 0, and in my Measure syntax I set it to return 0 if it divides by 0, so when I use the data in the screenshot, the result is all 0, so I added a row of non-0 data.

 

The final page result is as follows:

vhuijieymsft_2-1715149706366.png

 

The pbix file is attached.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

3 REPLIES 3
v-huijiey-msft
Community Support
Community Support

Hi @dkdirenzo ,

 

Thanks for the reply from ScottShearer and ExcelMonke .

 

Use the Divide function for division instead of “/”.

 

I have the same problem as you when I use “/”.

vhuijieymsft_0-1715149695551.png

 

For more information about the Divide function see:

vhuijieymsft_1-1715149695552.png

DIVIDE function (DAX) - DAX | Microsoft Learn

 

Can you try this Measure below:

Measure = DIVIDE(MAX('Table'[Denominator]), MAX('Table'[Numerator]),0)

 

I noticed in your screenshot that either the numerator is 0 or the denominator is 0 .

 

0 divided by any number is 0, and in my Measure syntax I set it to return 0 if it divides by 0, so when I use the data in the screenshot, the result is all 0, so I added a row of non-0 data.

 

The final page result is as follows:

vhuijieymsft_2-1715149706366.png

 

The pbix file is attached.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

ScottShearer
Resolver I
Resolver I

@dkdirenzo 

Are you using the DIVIDE function?

ExcelMonke
Solution Supplier
Solution Supplier

I think the issue is that you can't divide by zero ... 🤠 
Assuming your numerator and denominator values are "normal" (i.e. not a result of a complex measure), and in a number format, dividing the two should not kick back any errors. 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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