Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

2 Metrics in 1 Table

 

Measure 2 = 
DIVIDE(CALCULATE(SUM('Table A'[Time 1]), FILTER('Table A', 'Table A'[State 1] <> "X")),[Kilometers 1]) + 
DIVIDE(CALCULATE(SUM('Table A'[Time 2])/60, FILTER('Table A', 'Table A'[State 1] = "X")), SUM('Table A'[Kilometers 2]))

Basically this is the measure that I have so far, but not exactly the way I want it. Currently this takes the first formula and adds the second formula to the metric of each bar in the table. Instead it should just include the metric of the second table into the first table. I am assuming some sort of IF( function is to be used, but don't know how to properly implement.

 

I want these 2 measures to be able to show in 1 table

 

I hope this makes sense, let me know if further clarification is necessary. Thanks for the help.

 

  • Hi weir075,

     

    To achieve your requirement, you should create a "Category" column in your tables using "Unpivot Columns" and "Append" all the unpivoted tables like pattern below:

      

     

    Please check if it can meet your requirement.

     

    Regards,

    Jimmy Tao

     

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Example Data:

       Kilometer 1Hours 1Kilometer 2Hours 2
       1.20.880.570.6
       0.50.35  
       24.61.12.3
       0.780.57  
       0.331.3  
       1.689.020.370.62
       0.090.47  
      SUM6.5817.192.043.52
      Hr/KM2.611.73

       

      2 different times and 2 different kilometers creating 2 metrics. If I were to create a measure for one of the metrics it would be:

      Measure 1 = DIVIDE(SUM([Hours 1]), SUM([Kilometer 1])

      But I have 2 different metrics. How would I get these into 1 measure so they can all show in a single table instead of 2 separate tables like depicted in my first post. I want the metric for 2.61 and 1.73 to show in 1 table and achieved through 1 measure

      • v-yuta-msft's avatar
        v-yuta-msft
        Icon for Community Support rankCommunity Support

        Hi weir075,

         

        To achieve your requirement, you should create a "Category" column in your tables using "Unpivot Columns" and "Append" all the unpivoted tables like pattern below:

          

         

        Please check if it can meet your requirement.

         

        Regards,

        Jimmy Tao