Forum Discussion
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:
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):
So what I need is a slicer where the user can select which dimensions they want to see:
After making these selections, the table would be filtered and only the selected columns will display:
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!
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.
4 Replies
- parry2kSuper 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.⚡
- AnonymousNot applicable
parry2k Thanks for the tip, I assume that should work great, I'll try it out shortly!
- v-xuding-msftCommunity Support
Hi Anonymous ,
Does matrix work for you? If yes, please accept parry2k's answer as solution. More people will benefit from this thread.