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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Filter table before pivoting

I have an issue which I suspect is easy to do, but I can't get there yet. I have a table which I need to pivot and flatten out. But the user needs to be able to filter out some of the data which gets pivoted so that different columns appear based on what's been filtered out.

 

For example, this is the original table before the pivot:

pivot 1.PNG

Once I do the pivot, I'll have columns for each value in Dimension_code, like this (I've masked the data with xxxx for client confidentiality reasons):

pivot 2.PNG

 

So what I need is a slicer where the user can select which dimensions they want to see:

pivot 3.PNG

 

After making these selections, the table would be filtered and only the selected columns will display:

pivot 4.PNG

 

So in theory I need to filter the table before the pivot step is done in query editor. I suspect this is easy, but can't figure it out. Can anyone help?

 

Thanks!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.  If you still have questions, please feel free to ask us.

 

Best Regards,
Xue Ding
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

4 REPLIES 4
parry2k
Super User
Super User

@Anonymous I don't think you need to pivot the data, just use a matrix visual, put dimension set id on rows, dimension code on the column, and measure on values.

 

Create a slicer on dimension code to select which dimension you want to see

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.

Anonymous
Not applicable

@parry2k  Thanks for the tip, I assume that should work great, I'll try it out shortly!

Hi @Anonymous ,

 

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.  If you still have questions, please feel free to ask us.

 

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

Hi @Anonymous ,

 

Does matrix work for you? If yes, please accept parry2k's answer as solution.  More people will benefit from this thread.

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.