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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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 @Anonymous 

 

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 @Anonymous 

 

  • 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

 

Anonymous
Not applicable

hi,

Here is what I am looking for.IMG_7228.jpg

Anonymous
Not applicable

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 @Anonymous 

 

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

 

Thanks

Anonymous
Not applicable

This is what I am looking for .

IMG_7228.jpg

 

Hello @Anonymous 

 

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

 

Anonymous
Not applicable

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.