Forum Discussion
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
- Greg_Deckler
Community Champion
Nope, I read this a couple times and am at a loss. Sample data. 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
- AnonymousNot applicable
Example Data:
Kilometer 1 Hours 1 Kilometer 2 Hours 2 1.2 0.88 0.57 0.6 0.5 0.35 2 4.6 1.1 2.3 0.78 0.57 0.33 1.3 1.68 9.02 0.37 0.62 0.09 0.47 SUM 6.58 17.19 2.04 3.52 Hr/KM 2.61 1.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
Community 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