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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How can I hide data from populating Visuals until I filter it in?

Hi,

 

I apologize if I'm not wording my question properly. Let me start off with a little background about the dashboard I'm working on. I'm in the process of creating a dashboard that tracks certain information that has to do with individual employees. I guess my question is better phrased as follows: How can I restrict the dashboard from displaying any data, until, for example, someone clicks a specific name in a visual pointing to a table with a list of employee ID's and names. The data associated with those IDss and names then, and only then, populates the dashboard with the data specific to that employee. I'm not sure if this is even possible with Power BI's current state, but I suspect it would be possible with the correct contains, does not contain, starts with, etc. statements using the advanced filtering feature. Any insight would be appreciated!

1 ACCEPTED SOLUTION
chrisu
Responsive Resident
Responsive Resident

I do the same thing when reporting survey data.  All visuals are blank until a user selects a question from a slicer.  To do this, I first created a measure using IF and HASONEFILTER to check whether one question is selected:

 

QuestionSelectCheck = IF(HASONEFILTER(SurveyQuestions[Question]),"1","2")

 

Then, for each visual, I drag that into the visual level filters box and set it to display if QuestionSelectCheck = 1.  

 

Note that this doesn't remove everything (headers and titles and what not are still there for each visual), but it does remove all the data from the visual.  

 

Depending on your specific needs, you may need HASONEVALUE, ISFILTERED, or even a COUNTA/DISTINCTCOUNT instead of or in addition to HASONEFILTER.  See http://www.powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/.  

 

 

 

 

View solution in original post

12 REPLIES 12
chrisu
Responsive Resident
Responsive Resident

I do the same thing when reporting survey data.  All visuals are blank until a user selects a question from a slicer.  To do this, I first created a measure using IF and HASONEFILTER to check whether one question is selected:

 

QuestionSelectCheck = IF(HASONEFILTER(SurveyQuestions[Question]),"1","2")

 

Then, for each visual, I drag that into the visual level filters box and set it to display if QuestionSelectCheck = 1.  

 

Note that this doesn't remove everything (headers and titles and what not are still there for each visual), but it does remove all the data from the visual.  

 

Depending on your specific needs, you may need HASONEVALUE, ISFILTERED, or even a COUNTA/DISTINCTCOUNT instead of or in addition to HASONEFILTER.  See http://www.powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/.  

 

 

 

 

Anonymous
Not applicable

@chrisu @Anonymous

 

I have been working on some thing similar to what you have shown below . I have created a measure using HasOneFilter and dragged it to visual filters and set it to display 1 . It is working as expected. However, Select All is not coming back with any results. 

 

Select All and selecting None are not showing up any thing on charts and data will generate in charts only when we select something from filters. Is there a reason for that ? Why arent we seeing any thing when I choose Select All from filter ?

 

Please assist me with this !!! 

The reply may be a bit late but i just found a solution that worked for me.

All other solutions just gave me either all 1 or all 2regardless if i selected anything or not 

 

 

Selection Check = IF(CALCULATE(HASONEVALUE(Employee[Name]); ALLSELECTED(Employee)) = TRUE(); 1;2)

I am from germany so i am using ";" instead of ","

 

 

Hope this helps someone 🙂

Helped me,

Thanks

This worked for me - AWESOME - thank you so much !!!!

I am using a Table visual of Employees. It doesn't have any measures in it, just columns. Each employee has a row for each year they have history. 

 

I have a Smart Filter slicer visual that allows the user to type in an employee name and filter the details table by that employee. I would like the table to be empty until an employee name is selected in the slicer. 

 

I have created a filter selected measure:

 

Employee Is Filtered = if(HASONEFILTER(Employee[Employee Name]) || HASONEFILTER(Employee[Employee Number]),1,0)

 

Since the details table isn't aggregating the employee data, each row returns 1 for this measure (the "grand total" row of the table shows 0). So the table shows all employees until an employee is selected in the slicer, rather than not showing any employees. 

 

I was quite happy to find this post and try out the technique here, but it looks like it only works for visuals that aggregate details. 

 

Any ideas to make this work?

 

Mike

chrisu
Responsive Resident
Responsive Resident

Mike,

 

I have used an alternate method using ALLSELECTED to do the same thing.  ALLSELECTED forces the measure to disregard the table's row/column context.  Something like this:

 

Employee Is Filtered = IF(CALCULATE(COUNTA(Employee[Employee Name]), ALLSELECTED(Employee[Employee Name]))=1,1,0).

 

See http://tinylizard.com/all-vs-allselected/ for more details.  

 

 

That's still not quite working. 

 

The problem I believe is that the Table's visual filter is evaluating the measure for each row displayed in the table, not in the context of the collective rows in the table. 

 

EmployerFilter.PNG

chrisu
Responsive Resident
Responsive Resident

Maybe try ALLSELECTED with the table reference instead of the column? Like this: ALLSELECTED[Employee]

Anonymous
Not applicable

Chris,

 

Exactly I was looking for. I'll go ahead and look into implementing these for all of my visuals that I need to be filter dependent. Thank you!

Hi @Anonymous, @Anonymous,

 

I need some help from you all. I need to hide my data from Card Visual chart in Power BI at initially in dashboard. I used some slicers for filters in my report. I want to show my card visual data while I am being selected some values from slicers.

 

Please find the attachment for the reference. I want to show no. of units based on product release and ceiling type charts data labels either should be hide initially or should be shown balnk value.  If I would apply any filter from product release and ceiling type then my data should be shown.

 

As per below picture, it shows all units values even if I dont apply any filter.

card .jpg

Could you please kindly help me that how to resolve this issue in power bi.

Thanks in advance.

 

Thanks & Regards

Sridevi

Anonymous
Not applicable

Sridevi,

 

Were you able to create the measures in order to hide your data until filtered? If not, reply to this and I'll be happy to assist if I can.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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