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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Divide with denominator as measure and numerator as related values from different table

Hi

I am trying to define measure that gives "cost per kilometer"

 

I have a fact table having [Equipment], [Loaded Distance] and [Deadhead Distance] column

a dimention table called fixed Cost having [Equipment N] and [Fix Cost] columns

 

14.PNG

 

I have a measure

 

 

Equipment KMS = CALCULATE(SUM('Prototype Modeling_Freight'[Loaded Distance]) + SUM('Prototype Modeling_Freight'[Deadhead Distance]))

 

 

 

Shown as a table visualization

13.PNG

Through a relationship connection between Equipment and Equipment N

12.PNG

 

MY REQUIREMENT :

A measure defined for each equipment as [Fix cost] / [Equiment KMS]

 

TIA

5 REPLIES 5
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

You can use this measure.

 

Measure = Divide (Calculate (Sum ('Table'[FixedCost])), [Equipment Kms])

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a  Kudos!!

Anonymous
Not applicable

@harshnathani

Thanks for replying

 

I tried your formula as

FC Per KMS = Divide (Calculate (Sum ('Fixed Cost'[Fix Cost])), [Equipment Kms])

But not getting correct results

15.PNG

Hi @Anonymous ,

 

You can try this.

 

Divide (Calculate (Sum ('Fixed Cost'[Fix Cost]),ALLEXCEPT (Fixed Cost, 'Fixed Cost' [Equipment])), [Equipment Kms])

 

Also, convert your measure into decimals and make the values are 'Dont Summarize'

 

Imcase this does not work, please share some sample data.

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

Anonymous
Not applicable

Thanks @harshnathani 

 

This didnt work either

 

Sorry I cant share data in document as I am restricted to do that

 

Although, I would like to know one thing, can we use unique related values from a dimention table and use them in the expression ?

for eg:

the column [equipment] in my fact table is related to [equipment N] in dimention table.

Now what I want is to pull this fix cost from dimention table and use it in an expression, so that it goes to dimention table and give me the related value for every row iteration.

I am able to use it in a direct table visualization, but can't use it in a mathematical expression

16.PNG

Anonymous
Not applicable

Is this not possible?

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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