Forum Discussion
sammy02hk
Helper I
3 years agoDax SelectedValue With And Condition
Hi there,
I successed to form a filter with selectedvalue.
However for the screen cap below, the Article 301514200 didn't exist in "Biodegradable" but exist in "Active". The outcome I wish is that the sales record won't appear once I selected both "Active" and "Biodegradable".
SelectedNetSales(AND) =
VAR SRecordGRP =
ALLSELECTED ( 'Assortment Ori'[Record_Group] )
VAR SArt =
ALLSELECTED ( 'Assortment Ori'[Article_Code] )
VAR SRecord =
ALLSELECTED ( 'Assortment Ori'[Record] )
VAR SDate =
ALLSELECTED ( 'Assortment Ori'[YearMonth] )
RETURN
CALCULATE (
SUMX ( Sales, VALUE ( Sales[NET_SALES] ) ),
FILTER (
'Assortment Ori',
'Assortment Ori'[Record_Group] IN SRecordGRP
&& 'Assortment Ori'[Record] IN SRecord
&& 'Assortment Ori'[YearMonth] IN SDate
)
)
Thank you for your help.
Sammy Chu
Thank you for your help.
Sammy Chu
2 Replies
- johnt75
Super User
There's a good article and video on using AND logic for slicers at https://www.sqlbi.com/tv/apply-and-logic-to-multiple-selection-in-dax-slicer/
- sammy02hk
Helper I
Thank you for your help. Let have a look.