Forum Discussion
Anonymous
4 years agoNot applicable
loop over multiple select slicer
Hi everyone
Here is my problem. I have a table (LDM LIVE) with a summary,labels and description columns with a slicer (Part number) from another table (EPICOR LIVE). I need to find if the slicer value is found in the table summary.
If just one selected value in the slicer is one I have no problems. I use the following dax measure and then filter with those who have a value of 1
IsContained =
var _slicer= SELECTEDVALUE('EPICOR LIVE'[Part number])
var _currentRow=SELECTEDVALUE('LDM live'[Summary])
var _currentRow2=SELECTEDVALUE('LDM live'[Description])
var _currentRow3=SELECTEDVALUE('LDM live'[Labels])
RETURN
IF(FIND(_slicer,_currentRow,1, FIND(_slicer,_currentRow2,1,FIND(_slicer,_currentRow3,1,FALSE()))),1,0)
However if the slicer has multiple select values I couldn't find a way to do the same calculation.
However if the slicer has multiple select values I couldn't find a way to do the same calculation.
Can someone help please ?
Hi Anonymous
Please tryIsContained = IF ( NOT ISEMPTY ( FILTER ( 'LDM live', NOT ISEMPTY ( FILTER ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ), CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] ) ) ) ) ), 1 )Anonymous
Please try
IsContained = IF ( COUNTROWS ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ) ) <> COUNTROWS ( ALL ( 'EPICOR LIVE'[Part number] ) ), IF ( NOT ISEMPTY ( FILTER ( 'LDM live', NOT ISEMPTY ( FILTER ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ), CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] ) ) ) ) ), 1 ) )
4 Replies
- AnonymousNot applicable
tamerj1 It worked perfect. Thank you
- tamerj1Community Champion
Hi Anonymous
Please tryIsContained = IF ( NOT ISEMPTY ( FILTER ( 'LDM live', NOT ISEMPTY ( FILTER ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ), CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] ) ) ) ) ), 1 ) - AnonymousNot applicable
tamerj1 What if I don't want the table to show anything if nothing is selected in the slicer ?
- tamerj1Community Champion
Anonymous
Please try
IsContained = IF ( COUNTROWS ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ) ) <> COUNTROWS ( ALL ( 'EPICOR LIVE'[Part number] ) ), IF ( NOT ISEMPTY ( FILTER ( 'LDM live', NOT ISEMPTY ( FILTER ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ), CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] ) || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] ) ) ) ) ), 1 ) )