Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I have a slicer in my data with the following options:
(Blank)
Option 1
Option 2
Option 3
When a user selects any of the options 1-3, I want the result to always display both the selected value and blank values as well.
Is there a way to achieve this through DAX?
Any help is much appreciated!!
Hi @vanya_val ,
Does it make sense? If yes, please accept it as solution. More people will benefit here.
@v-xuding-msft Thank you for this. The solution you linked looks perfect for my problem but for some reason I can't make it work! It's probably something in my model, I'll do a bit more testing and post an update.
Hi @vanya_val ,
Please reference the similar thread: Always select Blank in the Filter to have a try.
@vanya_val , Make sure these option are part of separate table/dim
Try new measure
Measure =
var _sel = selectedvalue(Dim[Dim1])
return
calculate(Sum(Table[Value]),filter(All(Dim),Dim[Dim1] =_sel || isblank(Dim[Dim1])))
Or
Measure =
var _sel = allselected(Dim[Dim1])
return
calculate(Sum(Table[Value]),filter(All(Dim),Dim[Dim1] in _sel || isblank(Dim[Dim1])))
Thanks very much @amitchandak for your reply.
I'm afraid I'm not sure how to apply the measure you suggested to the slicer, maybe I'm doing something wrong. Rather than summing the values, I am looking to filter a table visual with the slicer.
For example, I have a table visual showing a list of Products and their Colour. The Colour could be Red, Blue, Green or (Blank). When I select Green on the slicer I want the table visual to be filtered to show all products with colour Green or (Blank). But rather than summing up a value related to those products I just need to see a list of them. It sounds like I need a measure to say whether something is selected or blank, but I'm not sure how to write that in DAX.
@vanya_val If you want to create a measure to check if something is selected or not. You can create a calculated measure like below
Proud to be a Super User!
User | Count |
---|---|
97 | |
88 | |
76 | |
70 | |
63 |
User | Count |
---|---|
112 | |
96 | |
95 | |
67 | |
65 |