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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
matka123499
Frequent Visitor

Power Query divide

Hi,

 

I am trying to divide 2 columns in power query editor by adding a new column but when using simple / sign function I will get infinity, n/a etc return when 0 is included and when trying to use DIVIDE function it shows that it´s not recognized.

 

The two columns I need are 

=[#"Rental Value (ERV)"]/[Total Area]

 

Can you please help me so everything divided by 0 returns as blank without errors?

 

Thank you

 

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @matka123499 

Try the following code.

if [Total Area]<>0 then [#"Rental Value (ERV)"]/[Total Area] else null

Output

vxinruzhumsft_0-1709012914440.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-xinruzhu-msft
Community Support
Community Support

Hi @matka123499 

Try the following code.

if [Total Area]<>0 then [#"Rental Value (ERV)"]/[Total Area] else null

Output

vxinruzhumsft_0-1709012914440.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @matka123499 ,

You can use below query to check for the black values..

 

[Column Name] = IF ( 'YourTable'[Total Area] <> 0,

'YourTable'[Rental Value (ERV)] / 'YourTable'[Total Area],

BLANK () )

 

If you like this solution please upvote and consider marking it as solution accepted

 

Thanks!

I used bellow but get an error Token literal expected.

Column Name] =  IF ( 'Merged Data'[Total Area] <> 0,

'Merged Data'[Rental Value (ERV)] / 'Merged Data'[Total Area],

BLANK () )

Vijay_A_Verma
Super User
Super User

Use below. You can use anything else also in place of null

= try [#"Rental Value (ERV)"]/[Total Area] otherwise null

 

I tried this but still getting #Num! where anz of the divided columns is 0

Anonymous
Not applicable

Hi @matka123499 ,

 

try this one

Division Result = IFERROR(DIVIDE('YourTable'[Rental Value (ERV)], 'YourTable'[Total Area]), BLANK())

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors