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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.