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

Hiding Columns based on Filter

Hi All,

 

I am having a table as show below in Power BI Desktop Canvas,

 

Capture.PNG

I have set a filter on "Segemt" column in the Canvas. Now, If i select "Gift" in segment then only Columns "Store", "Segment", "Mug", "Pen" and "Doll" should be shown. Similarly, When I select "Stationary" then columns "Store", "Segment", "Pen" and "Note" only should be displayed and remaining columns should be hidden.

 

I have'nt got any blogs or post in online to perform the above functionality. So, I am posting here to know whether is there a way to do it in Power BI.

 

Thanks in advance.

 

Regards,

Mohanraj

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

Hi, @Anonymous 

Based on your description, it is unavailable to use the origin table data in the scenario. As a workaround, you can operate as following steps to achieve your requirement. I created data to reproduce your scenario.

 

You can click ‘Edit Query’, go to Query Editor, choose ‘Transform’, replace ‘0’ with ‘null’ in the table, click on 'Store','Segment' columns,click ‘Unpivot other Columns’, choose ‘Unpivot Other Columns’, click ‘Close and Apply’.

q1.png

q2.png

 

Finally, you may use the matrix visual to show the result and configure as follows.

q3.png

If I misunderstand you thought, please show me your expected output. I am glad to solve the problem for you.

 

Best Regards,

Allan

 

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

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

Based on your description, it is unavailable to use the origin table data in the scenario. As a workaround, you can operate as following steps to achieve your requirement. I created data to reproduce your scenario.

 

You can click ‘Edit Query’, go to Query Editor, choose ‘Transform’, replace ‘0’ with ‘null’ in the table, click on 'Store','Segment' columns,click ‘Unpivot other Columns’, choose ‘Unpivot Other Columns’, click ‘Close and Apply’.

q1.png

q2.png

 

Finally, you may use the matrix visual to show the result and configure as follows.

q3.png

If I misunderstand you thought, please show me your expected output. I am glad to solve the problem for you.

 

Best Regards,

Allan

 

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

Anonymous
Not applicable

Thanks @v-alq-msft for the quick workaround. To certain extend the solution was useful.

rajulshah
Super User
Super User

Hello @Anonymous ,

 

Can you provide basic structure involved for this visual?

Anonymous
Not applicable

Hi @rajulshah Basically the table which I have posted is the result of a table visual. Now, when I use a basic filter as I have mentioned in the mail the table structure should act in the way as I have mentioned in the post. Let me know in case if I didn't answer the question or misunderstood the question. Thanks, Mohanraj

If the solution posted by @v-alq-msft didn't work, please let me know if I can be helpful.

Thanks.

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.