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
Anonymous
Not applicable

Division Column Calculation For the Total of the column values

I have my data table that looks as follows:

Education SC.PNG

The bold shaded are the total (Sum of the columns). The third column (% values) is C row/ B row.

 

However, when I replicate the same in Power BI ( Columns A, B and C- I enter the data manually and when i bring it as a matrix, I change it to SUM). By using the DIVISION Formula, I am able to get the individual percentage values (Column C), but the total is not the same as 215/2100 = 10%. It only allows me to choose between count/sum/average but does not do the actual division.  

 

Steps Shows as follows:

1. Enter Data Manually

 

1.PNG

  1. Create a column for the Division.

2.PNG

As you can see, the total part of the division is not 215/2100. It chooses SUM as default and I can only choose between them. But Ideally i would like it to show 215/2100 - 10%.3.PNG

Any Help? Thanks!!

2 ACCEPTED SOLUTIONS
edhans
Super User
Super User

You don't want this in a calculated column. You want this in a measure that will dynamically handle totals and subtotals in grids and pivots.

 

Do this:

  1. Right-click on the table and select New Measure.
  2. Type this in:
  3. My Division = 
    DIVIDE(
        SUM(Trial[C]),
        SUM(Trial[B])
    )
    It should show totals correctly now. You may need to change the measure's format in the Modeling tab.


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

HotChilli
Super User
Super User

Since it's a straightforward divide, you could use a measure instead.

Measure = DIVIDE(SUM(Trial[C]), SUM(Trial[B]),0)

As a column, the total is simple addition.  As a measure, it evaluates according to context.

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

Since it's a straightforward divide, you could use a measure instead.

Measure = DIVIDE(SUM(Trial[C]), SUM(Trial[B]),0)

As a column, the total is simple addition.  As a measure, it evaluates according to context.

edhans
Super User
Super User

You don't want this in a calculated column. You want this in a measure that will dynamically handle totals and subtotals in grids and pivots.

 

Do this:

  1. Right-click on the table and select New Measure.
  2. Type this in:
  3. My Division = 
    DIVIDE(
        SUM(Trial[C]),
        SUM(Trial[B])
    )
    It should show totals correctly now. You may need to change the measure's format in the Modeling tab.


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.