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

Divide rows

Hello,

 

I am trying to create a table in which I want to include the rent, the square feet and calculate the Rent/square foot. In the subtotal I get wrong number because the default action in Power BI table is to sum the values in Rent/Square column. In my case I want to divide the total of rent by the total of square foot and not to sum the Rent Square feet comumn.  Can you please support with this?

 

Please see an example below.

 

Capture.PNG

Many thanks,

Marios

1 ACCEPTED SOLUTION

Hi

 

I guess you computed your Rent/Square Feet as a calculated column using the DAX language.

Because this is a ratio, you'd better use a measure rather than a calculated column. See more explanation here: https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/

Ralph Kimball summarizes this concept with this sentence : "You should always to the ratios of the sum rather than the sum of the ratios"

 

So, in your example, go to 'Modelling' Tab, create the following measure:

Rent/Squarefeet = Divide ( Sum(YourTable[Rent]) , Sum(YourTable[Square Feet]) , 0)

 

And use this brand new measure in the "values" of your tables & matrix.

 

 

View solution in original post

2 REPLIES 2

Hi

 

I guess you computed your Rent/Square Feet as a calculated column using the DAX language.

Because this is a ratio, you'd better use a measure rather than a calculated column. See more explanation here: https://exceleratorbi.com.au/calculated-columns-vs-measures-dax/

Ralph Kimball summarizes this concept with this sentence : "You should always to the ratios of the sum rather than the sum of the ratios"

 

So, in your example, go to 'Modelling' Tab, create the following measure:

Rent/Squarefeet = Divide ( Sum(YourTable[Rent]) , Sum(YourTable[Square Feet]) , 0)

 

And use this brand new measure in the "values" of your tables & matrix.

 

 

Anonymous
Not applicable

Many thanks Excelside, this looks to work fine.

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.