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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

undefined

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
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Has your problem been solved?

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Like this?

Measure = 
DIVIDE(
    SELECTEDVALUE('Fix cost'[Fix cost]),
    [Equipment KMS],
    BLANK()
)

mn6.PNG

Can you show the results you want in a table like mine? And indicate whether it is a measure or a calculated column.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

So can you put Equipment N from Fixed Costs in a visual with a measure like:

 

Measure = SUM('Fixed Costs'[Fix Cost]) / [Equipment KMS]

 

?

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hey @Greg_Deckler  Thanks for replying.

No, I don't want to sum it

I want to use unique related values from a dimension table and use them in the expression ?

for eg:

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

Now what I want is to pull this fix cost from dimension table and use it in an expression, so that it goes to dimension 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

 

 

I think what I am looking for is a "lookupvalue" or equivalent. But I am struggling to use it

 

Right going from the fact table back to your dimension would either require your relationship arrows to flow in reverse or in both directions or you would need LOOKUPVALUE or MAXX(FILTER(...),...).

 

Hard to be specific with LOOKUPVALUE and such, this may help you: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

 

It at least demonstrates the use of LOOKUPVALUE.

 

Otherwise, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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