Forum Discussion
WeeDiugster
3 years agoRegular Visitor
Using a Slicer to Set Filter Values on Other Columns
Hi I'm just starting out with DAX so apologies if this has been asked before. I have a table with 20+ flags. So things like IsCustomerRegistered, IsPensioner etc. Each flag has a 1 for YES and ...
Anonymous
3 years agoNot applicable
Hi WeeDiugster ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours. Please note that the flag name in the fact table you give and the other table are not exactly the same, please name it uniformly.
(2)Click "transform data", go to the power query editor, select the [ID], [Name] columns, click "Transpose other columns", and then click "Close and apply".
(3) We can create a measure.
Measure =
var _a = SELECTCOLUMNS('Table',"Flag",[Flag])
var _b = ADDCOLUMNS('Fact Table',"Flag",IF([Value]=1&&[Attribute] in _a,1,0))
return IF(OR(ISFILTERED('Table'[Flag])&&SUMX(_b,[Flag])=COUNTROWS(_a),NOT(ISFILTERED('Table'[Flag]))),1,0)
Then place [Measure] on the visual to filter.
(4) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WeeDiugster
3 years agoRegular Visitor
Thank you so much.