Forum Discussion
Filter if contains - DAX
hi !
i'm trying to calculate measure with a filter and i'm a bit stuck:
column 1 column 2
x 5
x,y 15
y 2
this is an example:
user will slice x or y. i want to calculate column 2 if user's choice contains
for example if he chose x then the measure will be 20, if y it will be 17
calculate (sum(column ),filter(table,contains(table,column 1,'x')))
that's is my idea but it doesn't work unfortuantly...
is someone have an idea? thanks a lot!
If you are using a slicer, you would get three values for Column 1, (x, 'x,y' and y), I think you would have to modify your data so that you have:
x 5
x 15
y 15
y 2
Then you could use basic aggregations with no filters.
3 Replies
- Greg_Deckler
Community Champion
If you are using a slicer, you would get three values for Column 1, (x, 'x,y' and y), I think you would have to modify your data so that you have:
x 5
x 15
y 15
y 2
Then you could use basic aggregations with no filters.
- MP_123
Microsoft Employee
i have table with the combinations, and a table with the distinct value
i don't want the slicer to show x,x,y,y, but only x,y
thanks Greg_Deckler
- Eric_Zhang
Microsoft Employee
MP_123 wrote:
i have table with the combinations, and a table with the distinct value
i don't want the slicer to show x,x,y,y, but only x,y
thanks Greg_Deckler
Greg_Deckler's advice is a good approach.
What is the table with distinct values like? The slicer would show distinct x,y, rather than x,x,y,y.