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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
emiec
Employee
Employee

Line Chart with different Lines from same table

Hi,

 

I have the following table, in which I want to graph the Minutes_Used into two seperate lines using JobType as the unique identifier. 

 

JobType can either equal 1 or 2

 

I want JobType == 1 on one line and JobType ==2 on another line.   How can I do this?  Should I create a measure with an IF Statement?  I'm really new to Power BI and could use the assistance.


Thanks!

Job.PNG

 

Here is what I did to get the graph in the proper format:

1. Created Two measures:

   A. Ad-HocMeasure = CALCULATE(SUM(Reporting[Minutes_Used]),FILTER(Reporting,Reporting[JobType]=2))

   B. BaselineMeasure = CALCULATE(SUM(Reporting[Minutes_Used]),FILTER(Reporting,Reporting[JobType]=1))

2. Plotted graph using JobEndTime as Axis and Measures above.

 

Graph.png

 

3 REPLIES 3
Anonymous
Not applicable

You would need to put the time as the x axis, your minutes used as your y axis and your job type as your legend. Power BI should work this all out but make sure you check that the summarisation of the minutes used is set to what you want, sum, average, etc.

That worked.  However, what if I wanted to add a third line, one with Total Minutes used? 

Hi @emiec ,

 

If you'd like to add more than one value, you have to create several measures instead. Your measure looks good. Were there any issues?

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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