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
Anonymous
Not applicable

Combine 2 total value in Line Chart

Hello,


I'm newbie in Power BI. I'm learning Power BI within 1 week and starting to practice more with some charts.

Now, I have the problem with the line chart.

 

I have the database which present the number of people leave the company in 2018 & 2019.

The idea is build the line chart as information below:

- the x-asis present 12 months

- the y-axis present the total of people leave the company in each month

- the line present the value of 2018 & 2019.

 

The problem is I don't know in Power BI how I can present 2 line (one of 2018, one of 2019) in the same chart.

I can do only for the 2018 or 2019 or the total of 2 years.

 

If I do it on excel, I have to create the table, calculate the total value of each month of each year. Then, I can draw it.

Do I need to calculate at the same way in Power BI?

 

image.pngimage.pngimage.png

 

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

We can create two measures to represent year 2018 and 2019 like below:

Measure2018 = CALCULATE(COUNTROWS(Data),YEAR(Data[Date])= 2018)
Measure2019 = CALCULATE(COUNTROWS(Data),YEAR(Data[Date])= 2019)

Then drag these two measure to value, the result will like below:

Snipaste_2019-04-03_15-38-28.png

Best Regards,

Teige

Anonymous
Not applicable

Thank you a lot.

I will try 

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.