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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ghouse_peer
Post Patron
Post Patron

Dynamic change for Yaxis line graph and Matrix visual

Hi Team,

 


I have a requirement. 

In my model I have 1 table which has columns 

Gross A
Gross B
Gross C
Net A
Net B
Net C

 

I want to take all these column names in 1 slicer. 

Slicer wil have drop-down of all these columns name.

 

I have 2 visuals 

1.Line Graph- X axis Date

2.Matrix Table wih diff columns

 

Now when a user selects Gross B from slicer Line Graph Yaxis should show Sum of Gross B

In Matrix visual normal values pertaining to Gross B should change.

 

Please help me with the solution. 

 

Thanks in advance

 

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Not sure of what you want to achieve but the initial thought i get is of restructing your data.  You should use the "Unpivot Other Columns" feature in the Query Editor.  To receive further help, describe the question, share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-zhengdxu-msft
Community Support
Community Support

Hi @ghouse_peer 

 

How the diff columns work in matrix? What is the structure of the table in which you store your data?

You know, it's hard to get the right outcome when you don't have enough data.

Please share your raw data(exclude sensitive data) or create some sample data, so that we can help you better.

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards

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

Hi @v-zhengdxu-msft @Ashish_Mathur 

 

Gross AGross BGross CNet ANet BNet C
3.412.340.213.3312.462.4
22.512.2102.410.412.4
10.3106.7504530

 

along with this i have date column in same table.

 

I have 2 visuals:

1. lin graph- Xaxis = Date; y=?

2. Matrix Visual- Date; Values=?

 

Now i want a slicer which should have a dropdown of all 6 column names:

Gross A

Gross B

Gross C

Net A

Net B

Net C

 

when a user selects Gross A , for line graph Y axis should show Sum of Gross A and Matrix Visual should show normal values as value which is available in table.

Likewise for Gross B, Gross C, Net A, Net B, Net C.

 

let me know any further information required.

 

 

 

Hi @ghouse_peer 

 

Please try this:

I add a date column for the reference.

Transform data > Select all the columns without date column > Transform > Unpivot Columns:

vzhengdxumsft_0-1715153379554.pngvzhengdxumsft_1-1715153400054.png

Close & Apply

Then add matrix and line chart:

vzhengdxumsft_2-1715153458049.pngvzhengdxumsft_3-1715153473343.png

The result is as follow:

vzhengdxumsft_4-1715153498778.png

 

Best Regards

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

the workaround and solution you have provided is direct.

 

But in my requirement i dont want to do any transformation because i do have other columns which may get affected.

 

As you have taken same column in matrix visual, but in my scenario there will be different columns and value should appear w.r.t slicer and same thoing for Line chart as well

 

 

 

Hi @ghouse_peer 

 

Do any transformation may get some other columns affected.

But you know, power bi's calculations are column-based, and if you don't convert them, you might do a lot of redundant calculations and even fail to get the correct outcome most of the time.

 

Best Regards

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

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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