Forum Discussion
Visualisations blank until something selected in a slicer
- 9 years ago
Hi Dave0145,
For your requirement, you can create a measure like this:
SlicerCheck = =if(calculate(distinctcount([SlicerColumn]),allsel
ected([SlicerColumn]))=1,"Y","N") Then place this measure in a table visual, set filter condition as is Y. If you want to select multiple values in a slicer, set is N.
For more information, see:
visual filter problem--unpredictable behavior
Best Regards,
Qiuyun Yu
Hi Dave0145,
For your requirement, you can create a measure like this:
SlicerCheck = =if(calculate(distinctcount([SlicerColumn]),allsel
Then place this measure in a table visual, set filter condition as is Y. If you want to select multiple values in a slicer, set is N.
For more information, see:
visual filter problem--unpredictable behavior
Best Regards,
Qiuyun Yu
- joshcomputer18 years ago
Helper V
I added the SlicerCheck to a test card to confirm it was picking up the slicer correctly and it shows a Y when sliced and N when not sliced. (which is great!). When I add the SlicerCheck to my other card (the one I actually need it to work on), I am adding it to the visual level filters area, it doesn't give me options to filter by. I can click the arrow to expand but I can't type in the contains box underneath.
this works on isolated card
SlicerCheck = if(calculate(distinctcount('DataSet'[Analyst]),allselected('DataSet'[Analyst]))=1,"Y","N")
My slicer is just a list of analyst names 'Dataset'[Analyst]
Please help me find out why the filtering isn't allowing me to click on anything. *if the funcationality isn't there for filter a card's visual then it shouldn't have the option to add there.
Can a KPI be used for this same purpose? Do it allow for the visual filter to be entered?
- Vish246 years ago
Helper II
joshcomputer1 are you able to solve that problem. I am facing the same problem. I need to show the text of selected name from the slicer on the card. Otherwise slicer should be hidden.But I am not able to add the filter on the card visual.
- Anonymous8 years agoNot applicable
What would the work around be for a Measure, not a column?
- Dave01459 years agoFrequent Visitor
thank you - that works.
- Anonymous9 years agoNot applicable
v-qiuyu-msft - great solution, thanks! +1
I did note that if you bring the measure onto a table as a column, then the calculation slows down considerably, so best to have it only on the visual level filter.
I noted also that you can't have it on the Page level or Report level filter, but you can of course drag it onto the visual level filter for other tables.
- AnetaK9 years ago
Helper V
Hello,
I've used this solution to hide a claster column chart and it works.
I've also tried to hide a card with text inside but the visual filter is not working, I can't choose anything, it's blocked.
Can anybody suggest what can be done in that situation?
Is it impossible to use a measure-filter in a card?
What I want to achieve?
I want the card to be invisible until a room on a visual is chosen.
- vega8 years ago
Resolver III
I'm not quite sure how this solves the problem. I thought I had a similar problem to OP. I need to have a table that is blank until someone selects something in the slicer (one or more values). This solution works fine for a slicer when multiple values cannot be selected. But when multiple values are selected, it does not work.
The formula is checking if there is one value selected. If we select one value this is fine, but multiple selected values are treated the same way as no value selected, this is where the problem is.
- RAHEEL8 years ago
Helper I
Excellent...that really helped...BUT where I have only one value in the SLICER Table it always reutrn the slicercheck to Y. Is there a way to get the same functionality with just one value in the slicer.
e,g, I have only one value. "SHOW' in the slicer and when the user select/clicks show on slicer only then it should display the data on visual and when the user deselect the SHOW on slicer it should reset the data. like I am trying to get the toggle button functionality from this. Thanks
Regards,
Raheel- joshcomputer18 years ago
Helper V
Maybe the slicer needs to be single select? When nothing is selected, it should work the same as a list with many options. I would test your measure on a card to see if when the slicer is used or not used, the card will switch. This functionality is sketchy. I never got it to fully work as intended with all measures. I wish there was a field in the controls to just "when nothing selected" display this "".
- joshcomputer18 years ago
Helper V
Hi NWBI,
I don't know if what you are trying to show is a measure or not, but if there is a DAX formula for it, then you can use the expression hasonefilter as a conditional statement (similar to iserror in excel) so you can set it to zero if no filter. I am sure you can type the word "Blank" and it will display, but not sure if you place "" it will actually be blank. Worth giving it a shot.
- Anonymous8 years agoNot applicable
I created a measure to do this. The measure counts the specific number of dates selected. I figure I can use this to filter based on the number of dates selected, so basically "plot data only when 10 or fewer days are selected".
Date Filtered = calculate(DISTINCTCOUNT('Data'[Date]),ALLSELECTED('Data'[Date]))I have a card on the report that shows the measure and it works appropriately. When I have nothing selected it counts all the unique dates (days). When I select one, two or whatever it counts correctly.
But when I add this to the filter on a visual it doesn't work. It's calculating the measure for each group of data (which is grouped by day and hour using the bin feature), meaning it always returns 1. How do I make this calculate for the whole page instead of per row/group in the chart?
- joshcomputer18 years ago
Helper V
So it's counting based on the grouping of the values rather than the distinctcount of dates? Can you use allexcept() in your measure and put the groupings name in there so it won't point to that element? Might be worth a shot.
- Anonymous8 years agoNot applicable
Hm... I tried
Date Filtered = calculate(DISTINCTCOUNT('Data'[Date]),ALLSELECTED('Data'[Date]),allexcept('Data','Data'[Date]))But it behaves the same way.
- Quentin6 years ago
Helper IV
Like joshcomputer1 and other that have comented,
this tecniques works for some vizuals but not for others, i'm able to put the measure in the filter pane section for the other vizuals but i cannot click or edit it, it seems block and i don't understand why...
Did anyone got why? - Anonymous5 years agoNot applicable
how can I hide " No data available to display" when doing this measure filter please
- Dharmendharan_L2 years ago
Helper I
Hi All,
The measure seems not working for me, Because I have select all option in my filter. If i select a value in the filter, report get filtered based on that, When select all option is selected, I didn't get any data. Please provide any possible solution to fix this issue
Thanks,Dharmendharan