Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Hiding Columns with 0 Value

Greetings all

I've a table where I put values in it (example below). 

I want to be able to hide Q3-Incentive and Q4-Incentive when we are in Q2. When I enter Q3, then, then I wish to show Q3-Incentive column.

I would appreciate any help or maybe giving me other options.

 

NameQ1-IncentiveQ2-IncentiveQ3-IncentiveQ4-IncentiveTotal
John Doe$2,000$3,50000$5,500
  • Hi, Anonymous 

    Try to create measures as following:

    isShow = 
    var _when =dt"2022-6-30"  //set as you want
    var _today=TODAY()
    return 
    IF(MAX('Table'[Date])<=_when,1)
    _Value = CALCULATE(SUM([Value]),FILTER('Table',[isShow]=1))

    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

4 Replies

  • Anonymous , change you measure like this and try

     

    if([measure]=0, blank(), [measure])

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak  those are calculated columns. Can I use the same approach?

    • Anonymous's avatar
      Anonymous
      Not applicable

      It didn't work, the column showed as blank. I don't want to see the column at all when it's blank or 0.

       

  • Hi, Anonymous 

    Try to create measures as following:

    isShow = 
    var _when =dt"2022-6-30"  //set as you want
    var _today=TODAY()
    return 
    IF(MAX('Table'[Date])<=_when,1)
    _Value = CALCULATE(SUM([Value]),FILTER('Table',[isShow]=1))

    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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