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
QNLP
Frequent Visitor

HELP! complicated grouped line chart

1000011143.jpg

 How can I draw this graph in powerBI?

 This graph shows "defect ratio" according to elapsed months. Each single line means manufactured month. But the legend and color should be by "model"

  • I think all data table are already well prepaired but I couldn't find how to draw  this. I mean....when I put "model" in legend, manufactured month is totally ignored(just one line per model). when I put "manufactured month" in legend, model is ignored.

 

My table has columns as follows

Modelname, manufactured month, elapsed month, defect ratio

 

I have drawn this graph successfully with altair library.

 

Thank you.

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The Deneb visual in Power BI can give you that directly, but the standard line chart can do it too (until you hit the forced binning thresholds)

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

View solution in original post

7 REPLIES 7
QNLP
Frequent Visitor

Dear Super User,

Thank you for kind help.

Now I pasted the sample data that covers my issue.

I am really looking forward to learning it !

* Data is seperated by TAB

Model Mfd_month Elapsed_month Ratio
Model_A 202405 1 0.8
Model_A 202405 2 1.131
Model_A 202405 3 1.386
Model_A 202405 4 1.6
Model_A 202405 5 1.789
Model_A 202405 6 1.96
Model_A 202405 7 2.117
Model_A 202406 1 1
Model_A 202406 2 1.414
Model_A 202406 3 1.732
Model_A 202406 4 2
Model_A 202406 5 2.236
Model_A 202406 6 2.449
Model_A 202407 1 1.2
Model_A 202407 2 1.697
Model_A 202407 3 2.078
Model_A 202407 4 2.4
Model_A 202407 5 2.683
Model_A 202405 1 0.15
Model_B 202405 2 0.212
Model_B 202405 3 0.26
Model_B 202405 4 0.3
Model_B 202405 5 0.335
Model_B 202405 6 0.367
Model_B 202405 7 0.397
Model_B 202406 1 0.3
Model_B 202406 2 0.42
Model_B 202406 3 0.52
Model_B 202406 4 0.6
Model_B 202406 5 0.671
Model_B 202406 6 0.73
Model_B 202407 1 0.4
Model_B 202407 2 0.566
Model_B 202407 3 0.693
Model_B 202407 4 0.8
Model_B 202407 5 0.894

Like this ?

lbendlin_0-1733947181727.png

 

QNLP
Frequent Visitor

No, sir. Just two colors.

Model_A : blue

Model_B : red.  for example.

That will require a custom visual unless you want to hard code the colors.

lbendlin_0-1733951998174.png

 

with Series labels

lbendlin_1-1733952059664.png

 

 

QNLP
Frequent Visitor

Today I used Deneb and it works as you said!

Thank you.

 

"data" : {"name": "dataset"},
"mark" : 'trail",
"encoding": {
"x": {"field": "elapsed", "type": "quantitative"},
"y": {"field": "ratio", "type": "quantitative"],
"color" : {"field": "project", "type": "nominal"},
"detail" : {"field": "Mfd_month", "type": "ordinal"}

 

But I have another problem here.

This "deneb" line chart is not filtered by related tables. (But slicer DOES affect it)

 

If I choose "New visual calculation" through "More options"(•••) ,

1000011181.jpg1000011182.jpg1000011186.jpg1000011185.jpg

it shows good filter chart in a big window, I wanted to see, but if I back to report, the well-filtered chart is shown just for less than 1 second and un-filtered chart is shown instead.

 

Could you tell me how to solve this problem?

I don't know how well Visual Calculations are supported.  It might work as it's a data frame at the end of the day, but there may be limitations.  You'll have to try it out.

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

The Deneb visual in Power BI can give you that directly, but the standard line chart can do it too (until you hit the forced binning thresholds)

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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.