Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kulki06
Regular Visitor

How to compare multiple rows for a given column

Folks,

  I have a table like below which I import from mysql database. My goal is compare each of the metrics for a given model+submodel combination.

 

May be a clustered bar grap where first column will show metric1 of abc model 123 submodel beside metric 2 of def model 456 submodel --separate clustered graphs for all metrics in the same graph -- How do I achieve this. Pretty much compare rows for all the metrics and somehow create a legend to mention which color refers to which model and submodel combination. Thanks.

 

 

IDModelSub Modelmetric1metric2metric3metric4
1abc123110.0100.0300.0120
2def456220.1300.1400.1500.5
3ghe567    
4      
2 ACCEPTED SOLUTIONS

Hello @kulki06 

 

Below are two variants. 1st is what you showed as per your last post and 2nd is as per your 2nd post. You can choose any one. PowerBI file is attached.

 

Thingsclump_0-1645857883602.png

 

Feel free to accept as solution so that others find it easy to get solution.

 

Thanks,

www.thingsclump.com

 

View solution in original post

Hi

 

I believe you need a bridge table to resolve this. You can create a table (let's call it bridgetable) with unique IDs. Create a relationship with bridgetable and table with all metric values. This relationship will be 1 to many.

 

Thanks

 

View solution in original post

8 REPLIES 8
Thingsclump
Resolver V
Resolver V

Hi @kulki06 

 

  • In powerquery editor, go to "Transform" tab. Select metric1,2,3,4 columns and click on "unpivot columns". Rename "attribute" column to "metric". Rename "value" column to "metric value". Close and apply to load the data.
  • Now create a clustered column chart. "Model" and "sub model" field should be in Axis. Put "metric" field to Legend. Put "metric value" field to values.

You have to drill down to see model and sub model details.

 

Feel free to Accept it as a solution if this is what you expected.

 

 

Thanks

www.thingsclumpcom

 

hi,

Here is what I am looking for.IMG_7228.jpg

Hi,

 

Thanks for the solution but it is displaying all the metrics for a given model. What I am trying to get is multiple clustered column for each metric side by side. As you can see below --for a given model is showing all the metrics clustered. Lets say we have 4 models --then for each metric I would like to display 4 clustered columns , one each for one model. I was able to do it for onbe metric by having the id as legend and the metrics as values . But I could not add multiple values. I am also actually ok with the just the id being the legend since I am generating the id as "model_submodel" . TIA.

 

kulki06_0-1646059264757.png

 

Hi @kulki06 

 

Can you please show what you are expecting in graphical way? You can use paint or powerpoint or any other software.

 

Thanks

This is what I am looking for .

IMG_7228.jpg

 

Hello @kulki06 

 

Below are two variants. 1st is what you showed as per your last post and 2nd is as per your 2nd post. You can choose any one. PowerBI file is attached.

 

Thingsclump_0-1645857883602.png

 

Feel free to accept as solution so that others find it easy to get solution.

 

Thanks,

www.thingsclump.com

 

Thank you very much , but since my id was declared as a primary key in the DB I am getting the following error.

 

Is there anyway to overcome this ? else I have to go back and change the schema in the database and very the PK constraint.

 

kulki06_0-1646107342841.png

 

Hi

 

I believe you need a bridge table to resolve this. You can create a table (let's call it bridgetable) with unique IDs. Create a relationship with bridgetable and table with all metric values. This relationship will be 1 to many.

 

Thanks

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors