Forum Discussion

fstupot's avatar
fstupot
Icon for Helper II rankHelper II
6 years ago
Solved

trying to add fixed value to groups

hi all,

 

would really appreciate some help, ive been teaching myself powerbi for a week now and have hit a  brick wall

 

i am trying to show how much it costs to carry out some work per hour.

 

i have a long list of codes i have grouped into different work types as they all have different costs.

 

for the three work groups i have created i want to muliply by an hourly materials rate and then also add a fixed salary rate for the hour on there.

 

when i use "quick measure" to multiply the material costs (i have created them on a seperate table with the relevant user group name) with the meters worked.......it only lets me multiply the sum of all the use group material costs.

 

i know i am doing something very wrong, any help i would really appreciate]

 

lucy x

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi fstupot ,

    Could you please provide some sample data in your model and your expected result? The field hourly rate is existed field in table or it need to be added into table? Not sure whether the below measure is what you want or not...

    Material costs = MAX('_Work'[materials])*SWITCH(MAX('_Work'[work type]),"cut and break",50,"planer",51,"velocity",52)

    Best Regards

    Rena

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Lucy, 

     

    Have you created a relationship yet using the modelling tab? 

     

     

    If not. Go there, and you'll need to link the datasets. so for example, if both datasets are related by dragging one column to the other. 

     

    then try again 

     

    • fstupot's avatar
      fstupot
      Icon for Helper II rankHelper II

      thank you

       

      thats really useful, however when i use quickmeasure to multiply hours worked by the below "material cost" and "hour cost"....it still just says that i can only use the SUM of all the material/hourly costs

       

      work typematerialshourly rate
      planer1750
      cut and break1751
      velocity1552

       

      really appreciate all the help guys xxx

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi fstupot ,

        Could you please provide some sample data in your model and your expected result? The field hourly rate is existed field in table or it need to be added into table? Not sure whether the below measure is what you want or not...

        Material costs = MAX('_Work'[materials])*SWITCH(MAX('_Work'[work type]),"cut and break",50,"planer",51,"velocity",52)

        Best Regards

        Rena