Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Sathvik123
Helper V
Helper V

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

 

Sathvik123_0-1662530415004.png

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]))

 

Sathvik123_1-1662530682071.png

 

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

 

Sathvik123_2-1662530911983.png

 

Could any please please help what is the issue here.

 

 

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

Hi @Sathvik123 ,

 

Approve with @amitchandak .

Please try:

First, Create a slicer for date:

vjianbolimsft_6-1663133342076.png

 

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

 

Message = ""

 

vjianbolimsft_0-1663132594540.png

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"
      )

 

vjianbolimsft_2-1663132911425.png

Turn off Category label:

vjianbolimsft_5-1663133234857.png

 

 

Move the card to overlap the Profit visual

Fianl output:

vjianbolimsft_3-1663132930745.png

vjianbolimsft_4-1663132956125.png

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.

View solution in original post

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @Sathvik123 ,

 

Approve with @amitchandak .

Please try:

First, Create a slicer for date:

vjianbolimsft_6-1663133342076.png

 

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

 

Message = ""

 

vjianbolimsft_0-1663132594540.png

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"
      )

 

vjianbolimsft_2-1663132911425.png

Turn off Category label:

vjianbolimsft_5-1663133234857.png

 

 

Move the card to overlap the Profit visual

Fianl output:

vjianbolimsft_3-1663132930745.png

vjianbolimsft_4-1663132956125.png

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.

amitchandak
Super User
Super User

@Sathvik123 , 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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.