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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Synik
Helper II
Helper II

Allow a slicer to change columns on a matrix.

Hello all, I have a seemingly simple issue that I'm having trouble implementing. I have a simple matrix where the rows are categories, the values are profit and %GT profit, and the columns are years. For the purpose of this question, I'm focusing on the years. 

 

The goal here is to have a slicer affect the number of years displaying. 

For example, if A value is chosen, display years 2020 and greater

if any other value is chosen, display all years. 

I did some googling and this seems possible, but all the examples I viewed were more complex and I couldn't retool it to my issue. 

Any help would be greatly appreciated, thank you!

 

EDIT: here is some sample data and the expected output: 
Data: 
Year_Field = 2015-2022
Segment_Field = A, B, C 

Category_Field = X, Y, Z

 

Expected output in Matrix form: 

No slicers chosen = 

Category  2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022
X
Y
Z

Slicer selection of A = 
Category  2018 | 2019 | 2020 | 2021 | 2022
X
Y
Z

Slicer selection of B and C = 
Category  2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022
X
Y
Z

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Synik ,

 

You will need to create a slicer table like below:

vjaywmsft_0-1650531790488.png

Then create a relationship between slicer table and fact table by using year columns.

vjaywmsft_1-1650531846929.png

Then you should be able to filter the matrix by slicer.

vjaywmsft_2-1650531888149.png

vjaywmsft_3-1650531899252.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

8 REPLIES 8
v-jayw-msft
Community Support
Community Support

Hi @Synik ,

 

You will need to create a slicer table like below:

vjaywmsft_0-1650531790488.png

Then create a relationship between slicer table and fact table by using year columns.

vjaywmsft_1-1650531846929.png

Then you should be able to filter the matrix by slicer.

vjaywmsft_2-1650531888149.png

vjaywmsft_3-1650531899252.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
parry2k
Super User
Super User

@Synik no idea how I assume these are columns in the same table:

 

Year_Table = 2015-2022
Segment_Table = A, B, C 

Category_Table = X, Y, Z

 

Regardless, can you paste data in the table format. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

Yeah, no idea either, my post clearly says field! 😛

Seriously though, I'm not sure what you mean by table format, sorry. This is from 1 table with about ~20 columns. I would rather not post exact data and what I have structured already is the logic at its most basic. 

Can you elaborate a bit and I'll see if I can accomodate? 

parry2k
Super User
Super User

@Synik what is the relationship between these tables?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k These are not separate tables, just separate fields in the same table. 

parry2k
Super User
Super User

@Synik if you can put a sample data and the expected output, it will help to provide the solution.  It surely need some DAX juggle but doable.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 
I have updated my original post to include a simple example. 

@parry2k  are you able to assist? 

Post is a bit older, so not sure if I should repost or wait for a reply...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.