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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Ayoubid
New Member

Hide data in power bi table visual until a filters in slicers was selected.

hello all,

 

please i would like to have some help with my use case, actually know if what i want to do is possible.

i want to hide the content of table until values was selected in 2 slicers "date range" and "phone number" in order to perform an export to csv file in matrix vizual, the user mustn't have the visibillity to all data.

2 ACCEPTED SOLUTIONS
Sahir_Maharaj
Super User
Super User

Hello @Ayoubid,

 

you can achieve this by creating a DAX measure that will hide data in your Power BI table visual until both slicers are selected:

ShowData = 
VAR DateSelected = ISFILTERED('DateTable'[Date])
VAR PhoneSelected = ISFILTERED('PhoneTable'[PhoneNumber])
RETURN 
IF(DateSelected && PhoneSelected, 1, BLANK())

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

v-denglli-msft
Community Support
Community Support

Thanks for the reply from Sahir_Maharaj, please allow me to provide another insight.
Hi @Ayoubid ,

 

I'm not sure how your dataset is designed, here is my sample.

The test data is as follows.

vdengllimsft_0-1739155419407.png

 

Create the following measure to check the slicer selection.

SlicerCheck = 
VAR dateSlicer = CALCULATE(SELECTEDVALUE('Table'[Date]),ALLSELECTED('Table'[Date]))
VAR phoneSlicer = CALCULATE(SELECTEDVALUE('Table'[PhoneNumber]),ALLSELECTED('Table'[PhoneNumber]))
RETURN
IF(dateSlicer <> BLANK() && phoneSlicer <> BLANK(),1,0)

 

Add this measure to the filter pane of the matrix, set to is 1. And lock this filter to prevent other users from changing it.

 

The final results are as follows. Hopefully it will meet your needs.

vdengllimsft_1-1739155722543.pngvdengllimsft_2-1739155794516.png

 

 

Please see the attached pbix for reference.

 

Best Regards,
Dengliang 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

3 REPLIES 3
v-denglli-msft
Community Support
Community Support

Thanks for the reply from Sahir_Maharaj, please allow me to provide another insight.
Hi @Ayoubid ,

 

I'm not sure how your dataset is designed, here is my sample.

The test data is as follows.

vdengllimsft_0-1739155419407.png

 

Create the following measure to check the slicer selection.

SlicerCheck = 
VAR dateSlicer = CALCULATE(SELECTEDVALUE('Table'[Date]),ALLSELECTED('Table'[Date]))
VAR phoneSlicer = CALCULATE(SELECTEDVALUE('Table'[PhoneNumber]),ALLSELECTED('Table'[PhoneNumber]))
RETURN
IF(dateSlicer <> BLANK() && phoneSlicer <> BLANK(),1,0)

 

Add this measure to the filter pane of the matrix, set to is 1. And lock this filter to prevent other users from changing it.

 

The final results are as follows. Hopefully it will meet your needs.

vdengllimsft_1-1739155722543.pngvdengllimsft_2-1739155794516.png

 

 

Please see the attached pbix for reference.

 

Best Regards,
Dengliang Li

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

Sahir_Maharaj
Super User
Super User

Hello @Ayoubid,

 

you can achieve this by creating a DAX measure that will hide data in your Power BI table visual until both slicers are selected:

ShowData = 
VAR DateSelected = ISFILTERED('DateTable'[Date])
VAR PhoneSelected = ISFILTERED('PhoneTable'[PhoneNumber])
RETURN 
IF(DateSelected && PhoneSelected, 1, BLANK())

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
ahmedoye
Responsive Resident
Responsive Resident

Hi, can provide more information on this?

What you are saying for example is, you don't want the Matrix visual to display anything at all. Until when the user selects something in both slicers? Which means, if nothing is selected, the Matrix visual should technically be hidden?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors