Forum Discussion

francogf's avatar
francogf
New Member
9 years ago
Solved

Group / Slice metrics

Hi,

 

I'm new to Power BI (used other BI softwares in the past).

I'm trying to figure out if it's possible to do the following.

Is it possible to group metrics so we can slice by these groups in a graph (groups A & B in the example below).

So, in a graph we could filter Group to only see metrics from A or B, or both...

 

Thanks for your help.

 

  • 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

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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")

     

    • francogf's avatar
      francogf
      New Member

      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

      • Anonymous's avatar
        Anonymous
        Not applicable

        Check the "Unpivot" magic when editing your query.  Use that on the first table.