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

Create different line charts according to different subcategories

I'm currently creating Power BI's line charts. First, I'm required to create a matrix which contains several information below:

(1) the "row" is the category, then the subcategory is the index number. 

(2) the "values" are total PO values 

I want to achieve a condition such that when I click on the index number under the category. For instance, index is 577899 under the category A, I'll have a line chart such that X axis is a series of unique document numbers under the same index number 577899, then I have corresponding PO values, which are at the Y axis. 

 

Note that: Index number may be identical or maybe different because a product can be purchased at different times but the document number is unique. In the table view, each document number has a corresponding PO value. 

Here is a test data create for you:

 

Category Index numberDocument numberPO values
A5664776995$10000
B1234776996$12138
A5664776997$5232
C7984776998$111
D11194776999$7892
B4784777000$1111
B4784777001$892
D5554777002$333
C7934777003$123
2 ACCEPTED SOLUTIONS
Thejeswar
Super User
Super User

@Anonymous ,

This is very straight forward.

First build a matrix as you need. shown below ss

Thejeswar_1-1725263680653.png

Then build a line chart as you want

Thejeswar_2-1725263729432.png

 

Now set edit interaction option from matrix to filter the line chart as shown below

Click on the matrix -> click edit interaction -> selection filter in line chart

Thejeswar_3-1725263809877.png

 

Now if you click something in matrix, the below line chart will filter only for those documents. In the below snippet Index no 566 is clicked. Line chart gets filtered.

Thejeswar_4-1725263861866.png

 

I would prefer having a bar chart for the documents, as line is usually used with trends

Thejeswar_0-1725263612325.png

Regards,

View solution in original post

Sergii24
Super User
Super User

Hi @Anonymous, if I understood you correctly you want to achieve something similar to this:

Sergii24_1-1725264034358.png

So when you click on item in matrix, the line chart is filtered accordingly. However, you want the chart to appear only when an element in matrix is selected. Is it correct? If so, I don't think you can easily ahcieve the desired result (well, you can play around with line chart background transparency but some elements of it might still be visibile. In addition, you'll need to keep a dedicated space for line chart even when it's blank). You might obtain a similar result by using a tooltip (learn more about it here: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-tooltips and Power BI report page tooltip - How to create one in Power BI Desktop)

Here is a result, when you hover the mouse on matrix value:

Sergii24_2-1725264418908.png

If you like this approach, consider the following:

  • I suggest to add "Index number" as a part of X-axis hierarchy, because you might hover on a cell with more than 1 index:

Sergii24_0-1725264685967.png

  • I agree with @Thejeswar, using bar chart might be better in your case (because your POs are not connected in time, therefore connecting them with line could bring confusion)

Therefore, your final version could be like this:

Sergii24_1-1725264857504.png


You can find sample pbix attached. 

Good luck with your project!

View solution in original post

2 REPLIES 2
Sergii24
Super User
Super User

Hi @Anonymous, if I understood you correctly you want to achieve something similar to this:

Sergii24_1-1725264034358.png

So when you click on item in matrix, the line chart is filtered accordingly. However, you want the chart to appear only when an element in matrix is selected. Is it correct? If so, I don't think you can easily ahcieve the desired result (well, you can play around with line chart background transparency but some elements of it might still be visibile. In addition, you'll need to keep a dedicated space for line chart even when it's blank). You might obtain a similar result by using a tooltip (learn more about it here: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-tooltips and Power BI report page tooltip - How to create one in Power BI Desktop)

Here is a result, when you hover the mouse on matrix value:

Sergii24_2-1725264418908.png

If you like this approach, consider the following:

  • I suggest to add "Index number" as a part of X-axis hierarchy, because you might hover on a cell with more than 1 index:

Sergii24_0-1725264685967.png

  • I agree with @Thejeswar, using bar chart might be better in your case (because your POs are not connected in time, therefore connecting them with line could bring confusion)

Therefore, your final version could be like this:

Sergii24_1-1725264857504.png


You can find sample pbix attached. 

Good luck with your project!

Thejeswar
Super User
Super User

@Anonymous ,

This is very straight forward.

First build a matrix as you need. shown below ss

Thejeswar_1-1725263680653.png

Then build a line chart as you want

Thejeswar_2-1725263729432.png

 

Now set edit interaction option from matrix to filter the line chart as shown below

Click on the matrix -> click edit interaction -> selection filter in line chart

Thejeswar_3-1725263809877.png

 

Now if you click something in matrix, the below line chart will filter only for those documents. In the below snippet Index no 566 is clicked. Line chart gets filtered.

Thejeswar_4-1725263861866.png

 

I would prefer having a bar chart for the documents, as line is usually used with trends

Thejeswar_0-1725263612325.png

Regards,

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