Forum Discussion
Filter table based on slicer with multiselect for a column with combinations
- 4 years ago
Hi JFG123 ,
The way Samarth_18 shared ,only suitable for cases where the slicer selects only one value.When your slicer selects more than one value, an error will be reported.You could try the following ways.
Output:
Solutions:
Use the following dax to create new column:
first = LEFT(Data[Combination],1) second = MID(Data[Combination],3,1) third = RIGHT(Data[Combination])Then base on the base table ,create another table:
Table = UNION ( SELECTCOLUMNS ( Data, "Drop Down", Data[first], "Combination", Data[Combination], "value", Data[Value] ), SELECTCOLUMNS ( Data, "Drop Down", Data[second], "Combination", Data[Combination], "value", Data[Value] ), SELECTCOLUMNS ( Data, "Drop Down", Data[third], "Combination", Data[Combination], "value", Data[Value] ) )Final create visual:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
- 4 years ago
Hi JFG123 ,
It need to adjust on my before pbix file.
Output refer:
Measure:
Measure1 = CALCULATE(DISTINCTCOUNT('Table'[Drop Down]), ALLSELECTED('Table')) Measure2 = CALCULATE(COUNTROWS('Table'), ALLSELECTED('Table'),'Table'[Combination]=MAX('Table'[Combination])) Measure3 = IF([Measure2]>=[Measure1],1,BLANK())You could download my pbix file and refer it.
Best Regards
Lucien
This soln almost answers the question (so close...), this soln does A OR B filtering, I want A AND B when filtering as stated in OP. Is there anyway to modify yours or Samarth_18 post to get the AND functionality with multiple selections?
Hi JFG123 ,
It need to adjust on my before pbix file.
Output refer:
Measure:
Measure1 = CALCULATE(DISTINCTCOUNT('Table'[Drop Down]), ALLSELECTED('Table'))
Measure2 = CALCULATE(COUNTROWS('Table'), ALLSELECTED('Table'),'Table'[Combination]=MAX('Table'[Combination]))
Measure3 = IF([Measure2]>=[Measure1],1,BLANK())
You could download my pbix file and refer it.
Best Regards
Lucien
- JFG1234 years agoFrequent Visitor
Awesome!