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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
radmin
New Member

line graph for multiple items

Hi folks

 

all well? 

 

New to PowerBI and I have a question. Before I start, I've searched forum for an answer, and not found it - no doubt (being new!) I'm not using the correct search terms, so if there's an answer already there, apologies, and maybe someone could point me to it!?

 

I work for a health charity and we want to map numbers of people with a condition, over time. Ideally, we'd like a multi-line trend graph, with each condition mapped across multiple years, and if possible a slicer to select by condition (i.e. to show selected graph lines).

 

How do I go about this? Or perhaps it's not the best way to go. Data is organised, in excel, as follows

 

 year 1year 2year 3year 4year 5year 6year 7
condition 1datadatadatadatadatadatadata
condition 2datadatadatadatadatadatadata
condition 3datadatadatadatadatadatadata
condition 4datadatadatadatadatadatadata
condition 5datadatadatadatadatadatadata
condition 6datadatadatadatadatadatadata

 

many thanks

 

1 ACCEPTED SOLUTION
collinq
Super User
Super User

Hey @radmin ,

 

To bring this data in you just hook to Excel.  I put in numbers for each of the years so that the lines would separate.  I also put in the SAME number for each year so my lines are all straight - the real world is never like that.  So, this is what the data looks like initially in a table view:

collinq_0-1707859542014.png

 

 

Then, I created a slicer visual with the Condition field and that looks like this:

collinq_1-1707859568514.png

 

 

Then, I changed the table visual to be the Line Chart:

collinq_2-1707859611836.png

 

Now, when you select the slicer, you get the data for whichever condition you are lookng for.

 

I would suggest that you get a Date Dimension and add it to the data and then you can drill down by year.  There are lots of Date Dimension tables out there i you do a search but here is one we provide (with some reasoning for it):

Why Create a Date Table in Power BI? : :: Welcome To EPM Strategy ::




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

3 REPLIES 3
radmin
New Member

Thanks for the speedy reply, looks straightforward, I'll give that a go. 

Hi @radmin ,

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

Hope it helps.

 

 

Best Regards

Yilong Zhou

collinq
Super User
Super User

Hey @radmin ,

 

To bring this data in you just hook to Excel.  I put in numbers for each of the years so that the lines would separate.  I also put in the SAME number for each year so my lines are all straight - the real world is never like that.  So, this is what the data looks like initially in a table view:

collinq_0-1707859542014.png

 

 

Then, I created a slicer visual with the Condition field and that looks like this:

collinq_1-1707859568514.png

 

 

Then, I changed the table visual to be the Line Chart:

collinq_2-1707859611836.png

 

Now, when you select the slicer, you get the data for whichever condition you are lookng for.

 

I would suggest that you get a Date Dimension and add it to the data and then you can drill down by year.  There are lots of Date Dimension tables out there i you do a search but here is one we provide (with some reasoning for it):

Why Create a Date Table in Power BI? : :: Welcome To EPM Strategy ::




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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