cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nannimora
Helper I
Helper I

Hide Column on a Table or Matrix

Hello,

I would like to know if is possible show/hide column on a table/matrix when one or more conditions are verified.

I have to write a code (like visual basic?)

 

Thanks

G

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

Hi  @nannimora ,

 

You could realize it in a matrix.

First create a dim table;

Then create a measure similarly as below:

Measure = IF(NOT(ISFILTERED('Slicer table'[account])),CALCULATE(SUM('Table'[sales]),FILTER('Table','Table'[Type]=SELECTEDVALUE('Slicer table'[Type]))),
IF(MAX('Table'[account]) in FILTERS('Slicer table'[account]),CALCULATE(SUM('Table'[sales]),FILTER('Table','Table'[Type]=SELECTEDVALUE('Slicer table'[Type])))+0,BLANK()))

And you will see:

 

v-kelly-msft_0-1613641831768.pngv-kelly-msft_1-1613641846663.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @nannimora ,

 

You could realize it in a matrix.

First create a dim table;

Then create a measure similarly as below:

Measure = IF(NOT(ISFILTERED('Slicer table'[account])),CALCULATE(SUM('Table'[sales]),FILTER('Table','Table'[Type]=SELECTEDVALUE('Slicer table'[Type]))),
IF(MAX('Table'[account]) in FILTERS('Slicer table'[account]),CALCULATE(SUM('Table'[sales]),FILTER('Table','Table'[Type]=SELECTEDVALUE('Slicer table'[Type])))+0,BLANK()))

And you will see:

 

v-kelly-msft_0-1613641831768.pngv-kelly-msft_1-1613641846663.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Shishir22
Super User
Super User

Hello @nannimora ,

 

Your requirement is not clear. You can always use visual level filter to hide columns.

Can you please come up with example of what you are expecting?

 

Thanks!

Cheers,
Shishir

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.