Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

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

 

 

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

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    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]

     

    ?

     

    • Anonymous's avatar
      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

       

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

     

    Like this?

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

    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.

  • v-lionel-msft's avatar
    v-lionel-msft
    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.