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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Analitika
Post Prodigy
Post Prodigy

Lines in visual in Power BI

Hi,

 

I would like to ask how to make a visual where lines number be equal selected years number for example, I select 2021, 2022 then two lines appear in visual. Lines is described by measure. So how I could adapt my measure?

Here is a visual:

Analitika_0-1665477080695.png

Measure looks like this:

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

First make sure you have a date table. If you dont know what this is, star by reading this article and do some reserach about this, so that you understand the concept.

 

https://kohera.be/power-bi/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/

 

 

Then you can create something like this

 

jcalheir_1-1665482157765.png

 

 

Create a line chart and add to X-axis the Month, the facts to the Y-axis and add to the Legend the Year (This way you dont agregate you yearly values).

 

Then create a slicer for the year, and this way you can chose the years you want to display in the line chart

 

Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi,

 

First make sure you have a date table. If you dont know what this is, star by reading this article and do some reserach about this, so that you understand the concept.

 

https://kohera.be/power-bi/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/

 

 

Then you can create something like this

 

jcalheir_1-1665482157765.png

 

 

Create a line chart and add to X-axis the Month, the facts to the Y-axis and add to the Legend the Year (This way you dont agregate you yearly values).

 

Then create a slicer for the year, and this way you can chose the years you want to display in the line chart

 

Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.