Forum Discussion
Anonymous
6 years agoNot applicable
Display Not selected values from Slicer (Consider selections from other slicer)
Hello, I need your help in creating dax measure to display values which are not selected in a slicer. Customer Year A 2019 B 2019 C 2019 D 2019 B 2020 A 2020 A 2021 ...
Anonymous
6 years agoNot applicable
// Assumption:
// You've put a table on the canvas that
// holds Customers (their names or IDs).
// The source for this table will be a
// disconnected table that will only hold
// all the names of the customers.
// You can create such a calculated table with
// this command:
[Excluded Customers] = // table
distinct(
T[Customers]
)
// Say the table's name is 'Excluded Customers'.
// You also have 2 slicers that come from
// the T table.
// 1. Customer Names
// 2. Years
// Here's a measure that can be used for
// the table 'Excluded Customers' above to show
// the customers which have not been selected in the
// slicer.
[Should Show?] =
var __custCount =
DISTINCTCOUNT( T[Customer] )
var __totalCustCount =
CALCULATE(
DISTINCTCOUNT( T[Customer] ),
ALL( Customer )
)
var __shouldFilter =
__custCount < __totalCustCount
var __oneCustVisibleInExcludedCustomers =
HASONEFILTER( 'Excluded Customers'[Customer] )
var __oneYearSelected =
HASONEFILTER( T[Year] )
var __shouldShow = true()
&& __oneYearSelected
&& __shouldFilter
&& __oneCustVisibleInExcludedCustomers
var __result =
if( __shouldShow,
1 * NOT (
SELECTEDVALUE( DC[Customer] )
IN VALUES( T[Customer] )
)
)
return
__resultIWallis
Helper I
3 years agodoes this work for you? I was trying to solve a similar problem. But the code in the end is confusing, is there another table DC (this part of code --
SELECTEDVALUE( DC[Customer] )
)
and also this part
ALL( Customer )
, does this one belong to any table? Thank you!