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
  • v-kelly-msft's avatar
    5 years ago

    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!