Forum Discussion
How to create a measure that returns specific values from a column?
I want the slicer to include values from column A, but only those that exist in column B, which is a column from a different table.
Please help.
29 Replies
- MartynRamsden
Solution Sage
Hi Anonymous
It's not possible to use a measure in a slicer.
I understand you're not able to add calculated columns but are you able to add a calculated table?
Best regards,
Martyn
If I answered your question, please help others by accepting it as a solution.- AnonymousNot applicable
- MartynRamsden
Solution Sage
Hi Anonymous
Go the Modeling tab, then click 'New table'. You'll then need to enter a DAX expression for new table.
Your expression could be something like this:
NewTable = FILTER( ALL( Table1[ColumnA] ), Table1[ColumnA] IN VALUES( Table2[ColumnB] ) )This new table would contain a single column containing the values from ColumnA in Table1 that also exisit in ColumnB in Table2.
You can then use the new column as a slicer in your report.
Note: since there are no relationships to the new table, your measures will need to reference the new column (probably using TREATAS, VALUES or SELECTEDVALUE) so the slicer selction can be taken into account.
There are plenty of resources available about how to use disconnected slicers. Here are a few:
- powerpivotpro.com/2018/05/disconnected-slicers-with-dax-variables-selectedvalues/
- www.kasperonbi.com/dynamic-data-comparisons-using-disconnected-slicers-treatas-and-inactive-relationships/
Best regards,
Martyn
If I answered your question, please help others by accepting it as a solution.