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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Kanyi
Frequent Visitor

Division Calculations Incorrect

divide col 1 by col 2 = col3 and then cold5/col6 =col 4divide col 1 by col 2 = col3 and then cold5/col6 =col 4

 

Hi, Assistance kindly needed. I have a direct query data source with multiple columns, sorted by date. I have to add some columns to get a specific sum and then divide the sums of the 2 columns. When I do this in Power Query, I can not view the data on desktop, I get an error (Couldn't load the data for this visual: Divide by zero error encountered). I have tried to filter the rows with zero as an answer and still nothing works. Then I tried creating columns in the table in desktop mode, Divide function works, however, I am getting incorrect values from the division. How can I resolve this?

3 REPLIES 3
Kanyi
Frequent Visitor

Hi @mlsx4 , appreciate the help. I tried the solution, but it doesn't work. I get an error 'Too many arguments were passed to the SUM function. The maximum argument count for the function is 1). I also tried SUMX as I want division per row/date using the same formula, just changed function and that too yields an error.

mlsx4
Memorable Member
Memorable Member

Hi @Kanyi 

 

It seems you may forget some ")". In my formula, everything works fine.

mlsx4_0-1692353545607.png

If you want to include a SUMX, then you can do something like this:

Division = SUMX(VALUES(MyTable[Date]),DIVIDE(SUM(MyTable[A]),SUM(MyTable[B]),0))

mlsx4_1-1692353601017.png

 

mlsx4
Memorable Member
Memorable Member

Hi @Kanyi 

If you divide like this:

 

Division = DIVIDE(SUM(MyTable[A]),SUM(MyTable[B]),0)

 

mlsx4_0-1692346317471.png

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.