Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
I have a measure
Equipment KMS = CALCULATE(SUM('Prototype Modeling_Freight'[Loaded Distance]) + SUM('Prototype Modeling_Freight'[Deadhead Distance]))
Shown as a table visualization
Through a relationship connection between Equipment and Equipment N
MY REQUIREMENT :
A measure defined for each equipment as [Fix cost] / [Equiment KMS]
TIA
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!!
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
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!!
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
Is this not possible?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |