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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
4jhill
Frequent Visitor

Help: Hide visual based on the end date selected from Date slicer

Aim: create a measure that is applied as a filter to a donut chart visual so when a user selected a date after 16/06/2024, the visual is hidden.

 

I created a measure to add as a filter to the visual. (The measure is sitting under my calendar dim table)

4jhill_0-1733095834781.png

Under the filter panel I selected "show items when the value" "is" "0'' 

4jhill_1-1733095979827.png

4jhill_2-1733096095723.png

 

However, nothing happens to the visual when I select a date after 16/06/2024 from the date slicer. 

 

Any suggestions would be appreciated.

 

For privacy reasons I cannot share the PowerBi report.

1 ACCEPTED SOLUTION

Hi @4jhill ,

 

In Power BI, it is not possible to dynamically hide a visual directly. However, you can control the content of the visual by filtering its data source, making it display "No data." In your case, it is recommended to create a measure for the data table associated with the visual and use this measure to filter the visual.

 

Measure = IF(MIN('Calendar d'[Date])>DATE(2024,6,16)||MAX('Calendar d'[Date])>DATE(2024,6,16) ,1,0)

 

Best Regards,

Bof

 

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @4jhill ,

 

First, the settings in the Filter pane do not directly control whether a visual is displayed or not. Their primary function is to filter the data within the visual.

 

Second, the parameters in your DATE function are incorrect. The correct format should be DATE(Year, Month, Day). If your true intention is to filter the data, then the final formula can be revised as follows:

Measure = IF(SELECTEDVALUE('Calendar d'[Date]) > DATE(2024, 6, 16), 1, 0)

 

Best Regards,

Bof 

Hi Bof,

 

Thanks for that. Would you have any suggestions as to how best go about hiding a visual if a date selected on the date slicer is after 16th June 2024?

 

Cheers!

Hi @4jhill ,

 

In Power BI, it is not possible to dynamically hide a visual directly. However, you can control the content of the visual by filtering its data source, making it display "No data." In your case, it is recommended to create a measure for the data table associated with the visual and use this measure to filter the visual.

 

Measure = IF(MIN('Calendar d'[Date])>DATE(2024,6,16)||MAX('Calendar d'[Date])>DATE(2024,6,16) ,1,0)

 

Best Regards,

Bof

 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.