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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Interactive Line Chart

Hi all,

I need to design a custom visual of a line chart that has the option to change the year. Consider the following dummy data.

Screenshot from 2021-07-05 16-54-46.png

 

 

 

 

 

 

 

 

 

All the years in our xValue need to be displayed and the user chooses which year to display and the corresponding line chart is plotted. Is it possible to this in powerbi.

 

Thanks in advance

2 ACCEPTED SOLUTIONS
ibarrau
Super User
Super User

Hi. I will suggest something but it might be a good idea to read more about data modeling because using a Calendar Table will help you with any visualizations or DAX calculation regarding time/date.

If you just want to build this you first need to create a new column that will contain the year. You can do it on power query with operations like "text after delimiter". Delimiter can be white space. You can also do a "Extract last characters" using last 4.

Once you have that third year column you can create a line chart with Axis = xValue and Values = Sales. Then add a Slicer visualization with the Year (you can change the way it is build with the small down arrow when you mouse over the visual). I like the list of dropdownlist for this scenario to let the user change year by year the line chart.

I hope that helps.


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

Happy to help!

LaDataWeb Blog

View solution in original post

v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, just put the year field in the slicer. I did the following test:

vhenrykmstf_0-1625627558567.png

vhenrykmstf_1-1625627570936.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

 

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

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, just put the year field in the slicer. I did the following test:

vhenrykmstf_0-1625627558567.png

vhenrykmstf_1-1625627570936.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

 

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

ibarrau
Super User
Super User

Hi. I will suggest something but it might be a good idea to read more about data modeling because using a Calendar Table will help you with any visualizations or DAX calculation regarding time/date.

If you just want to build this you first need to create a new column that will contain the year. You can do it on power query with operations like "text after delimiter". Delimiter can be white space. You can also do a "Extract last characters" using last 4.

Once you have that third year column you can create a line chart with Axis = xValue and Values = Sales. Then add a Slicer visualization with the Year (you can change the way it is build with the small down arrow when you mouse over the visual). I like the list of dropdownlist for this scenario to let the user change year by year the line chart.

I hope that helps.


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors