cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Khan17
Regular Visitor

Show blank when nothing is selected in the slicers

Hello,

 

 

Capture.PNG

From the picture above, you can see that I have used 4 slicers to calculate different things i.e.e hours, billing amount and total amount.

 

If I do not select anything, it shows this value (refer to the picture above). These values are accumulated and mean absolutely nothing, they only mislead the user. Please if someone can tell me what to do? Is there any way/option I can use where my table shows blank or nothing if nothing is selected from the slicer? Thanks.

 

P.S New to Power BI, not that good with DAX.

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft
Microsoft

Hi @Khan17 ,

Please set a new measure:

Please new a measure:

Measure1 =
CALCULATE ( IF ( ISFILTERED ( Table[Column] ), 1, 0 ), ALLSELECTED ( Table ) )

Add this measure to visual level filters, and set its value to 1.

1.PNG

Regards,

Daniel He

 

Community Support Team _ Daniel He
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

8 REPLIES 8
Adeel_Yousaf
Frequent Visitor

In my case it works.

Measure1 =
CALCULATE ( IF ( ISFILTERED ( Table[Column] ), SELECTEDVALUE(Table1[Column1] ), "" ))

v-danhe-msft
Microsoft
Microsoft

Hi @Khan17 ,

Please set a new measure:

Please new a measure:

Measure1 =
CALCULATE ( IF ( ISFILTERED ( Table[Column] ), 1, 0 ), ALLSELECTED ( Table ) )

Add this measure to visual level filters, and set its value to 1.

1.PNG

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi there,
I have attempted to use this solution and succesfully created the measure. I have checked it using a card and it returns a value of zero when nothing is selected on my slicer and a value of 1 when something is selected. However, when I place it as a fliter for a visual, it does not let me set the vlaue to 1. It looks as shown in the picture and does nothing when I click the dropdown arrow to try to select "is" and then set the value to 1. Any suggestions? 

Thanks

LilMurph

LilMurph_0-1642439462690.png

 

Thank you Daniel.😊

I had the same problem here

Anonymous
Not applicable

Thanks, @v-danhe-msft it worked for me.

pborah
Responsive Resident
Responsive Resident

Hi,

 

This works for me but if I "Select All", I get a blank again. Why is that?

mtiedtke
Regular Visitor

@Khan17 

You can try using the function hasonefilter with your slicers so if your slicers have a filter then do the calculations, otherwise return blank(). 

https://docs.microsoft.com/en-us/dax/hasonefilter-function-dax

 

something roughly like 

TotalHours = if(hasonefilter(ClientDescription[name]),Sum(TotalHours),Blank())

 

Nopes, does not work. Basically, if I do not select anything from the slicer, my table should show blank but it does not. As you can see from the picture, it shows an accumulated value of something. I do not need that value if I have not selected anything!

 

 

My slicers are interlinked with each other (if that helps), for example if you choose an individual's name, the other slicers would show the parts that are only associated with the individual. 

 

 

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors