Forum Discussion

nannimora's avatar
nannimora
Helper I
5 years ago
Solved

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

  • 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:

     

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

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

2 Replies

  • 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!

  • v-kelly-msft's avatar
    v-kelly-msft
    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:

     

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

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