Forum Discussion
Group / Slice metrics
- 9 years ago
Hi francogf,
Here are detail steps to join those two tables:
1. In Query Editor, select columns from "Metric1" to "Metric5", then click Unpivot Columns.
2. Click Merge Queries as New to get a joined table.
3. Expand columns.
You can download attached .pbix file to have a look.
Best Regards,
Qiuyun Yu
Probably easiest to reshape your data in that case:
20170526 1001 Metric1 10 Group A
20170526 1001 Metric2 22 Group A
20170526 1001 Metric3 35 Group B
...
Given that shape, it should be fairly easy. You will need to write measurs like:
Total Metric 1 := CALCULATE(SUM(MyTable[Value]), MyTable[MetricName] = "Metric 1")
Thanks,
Actually, at the source we have two tables :
First one contains DateId, PlantId and the Metrics.
Second one contains Groups Ids and Metrics Ids.
In the first one, metrics are in columns, not in rows.
Is there a way to join those these 2 tables and transpose after import?
Table 1 :
DateId PlantId Metric1 Metric2 Metric3 Metric4 Metric5
20170526 1001 10 22 33 44 55
Table 2 :
GroupId MetricId
A Metric1
A Metric2
B Metric3
B Metric4
B Metric5
- Anonymous9 years agoNot applicable
Check the "Unpivot" magic when editing your query. Use that on the first table.
- v-qiuyu-msft9 years agoCommunity Support
Hi francogf,
Here are detail steps to join those two tables:
1. In Query Editor, select columns from "Metric1" to "Metric5", then click Unpivot Columns.
2. Click Merge Queries as New to get a joined table.
3. Expand columns.
You can download attached .pbix file to have a look.
Best Regards,
Qiuyun Yu- francogf9 years agoNew Member
Thank you very much for the detailed instructions :-)