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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
valleyman
Helper I
Helper I

Noobie question about line graphs, months and values

Hi

Still very much a noobie on PBI, but have been getting along quite nicely upto now. 

 

I have data that is a record of each time something happened to someone, in this case people going to hospital.

The data shows that in Dec 19, 2 people were admitted. In Jan 20, 3 people were admitted. In Feb 20, none were admitted. In March 20, 1 person was admitted on one occasion, and in April 20, so far 5 people have been admitted. This data is currently in row format, and doesn't give the totals for the months in question. 

 

Screenshot 2020-04-20 at 13.12.23.png

 

 

 

 

What I'm after is the way to produce this graph. The instances through the months have been totalled and shown like this. How do I do this in PBI? I've been able to do all kinds of other graphs, gauges, pie charts and display tiles through importing data from the SQL stored procedures I've written, but I just cannot get my head round the way in which PBI does this one element. 

 

Any help would be gratefully received.

 

Thanks

Ant

1 ACCEPTED SOLUTION

In You date table create month -year

 

Month - year = format([Date],"MMMM-YYYY")

Or

Month - year = format([Date],"MMM-YYYY")

In above case you need a sort column and mark that as sort column of first

Month - year Sort = format([Date],"YYYYMM")

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

7 REPLIES 7
Pragati11
Super User
Super User

Hi @valleyman ,

 

You can create a line chart in Power BI, with DATE on x-axis and count of Number of Admits on Y-axis.

you can refer following link for line charts in Power BI:

https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-line-chart

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

 

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@valleyman , Not clear. Can you share sample data and sample output.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Screenshot 2020-04-20 at 12.51.42.png @amitchandak Ignore the counts as I made them up for the purposes of the Excel example I was making, in order to make the graph I need to see in PBI. 

Hi @valleyman ,

 

After seeing your screenshot with sample, you can move your DATEDONE column to the x-axis of line chart. on y-axis you can move COUNT(WORKER) or COUNT(SERVICEUSER) as required on te chart.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@amitchandak thank you very much. That does work and I've kinda got to this point in the end before, but with the problem that the December 2019 figure is showing ahead of April 2020...

 

Screenshot 2020-04-20 at 14.13.27.png

How do I get it to look like the Excel example please? I get that it's because the DH shows Month and not Year, but I don't know how to rectify it where it doesn't show me the year info first. This is my Visualisation config below:

 

Screenshot 2020-04-20 at 14.13.50.png

 

In You date table create month -year

 

Month - year = format([Date],"MMMM-YYYY")

Or

Month - year = format([Date],"MMM-YYYY")

In above case you need a sort column and mark that as sort column of first

Month - year Sort = format([Date],"YYYYMM")

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @valleyman ,

 

This is Pragati.

 

On your chart move your complete "DATEDONE" column. Then on the line chart there is a capability to drill down on dates:

Year --> Quarter --> Month --> Day

 

If you just want Month-Year combination of your date column, once you move your date column to the chart, it shows the whole hierarchy as follows:

d10.png

 

From the above just keep Year & Month. Then on the chart when you drill down completly, your date is shown as Month-Year format.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors