Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to hide chart when nothing selected

Hello All,

 

I have table having data like below

 

Date          Sales     Profit   Qty

1/1/2022100202
2/1/2022200303
3/1/2022300406

 

So I have a bar chart having sales for each month like below

 

and whenever I clicked on the perticular month bar I need to show the corresponding profit in another bar chart down.

So I create a chart and did the interactions.

 

Here My requirement whenever no monthly bar selected I need to hide everything in the profit chart.

I made below dax but not working.

 

OverallProfitLogic =IF(HASONEVALUE(Sheet1[Date]),sum(Sheet1[Profit]))

 

 

I see that If I remove my date field from profit chart the chart is hiding, but the issue is the conditional formatting option  is not coming for this chart

 

 

Could any please please help what is the issue here.

 

 

  • Hi Anonymous ,

     

    Approve with amitchandak .

    Please try:

    First, Create a slicer for date:

     

    Use a measure like [Message] to create a Card visual:

     

    Message = ""

     

    Then apply the measure [Make Transparent] to the card's background color:

     

    Make Transparent = 
          IF(
             ISFILTERED('Table'[Date]),
             "#FFFFFF00", -- returns transparent if Check Filtered is True
             "White"
          )

     

    Turn off Category label:

     

     

    Move the card to overlap the Profit visual

    Fianl output:

    Best Regards,

    Jianbo Li

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

2 Replies

  • Anonymous , Create a measure and check for value 1 in visual level filter

     

    flag = int( calculate(isfiltered(Sheet1[Date]), allselected()) )

     

    you can also change backgound color based on this

     

    if( flag =1, "#FFFFFF00", "#FFFFFF")

     

     

    if( flag =1 "#FFFFFF", "#FFFFFF00") // #FFFFFF00 means transparent

     

    use them in background color: conditional formatting(Fx) using the field value option.

     

     

    There is no option to hide as of now

  • Hi Anonymous ,

     

    Approve with amitchandak .

    Please try:

    First, Create a slicer for date:

     

    Use a measure like [Message] to create a Card visual:

     

    Message = ""

     

    Then apply the measure [Make Transparent] to the card's background color:

     

    Make Transparent = 
          IF(
             ISFILTERED('Table'[Date]),
             "#FFFFFF00", -- returns transparent if Check Filtered is True
             "White"
          )

     

    Turn off Category label:

     

     

    Move the card to overlap the Profit visual

    Fianl output:

    Best Regards,

    Jianbo Li

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