Forum Discussion
Filter by multiple columns and customer segment
Hallo, I am power bi beginner and I have a problem with filter: so I want to differentiate customers, who has product sku 1 in their first order, sku 2 in their first order, sku 3 in their first order etc. Please see the example photo below. And how can I save this customer segment for future use, like put customer a and b in one "container” as they have sku 1 in their first order; put customer a and c in another container...
thank you very much!
- Anonymous3 years ago
Hi donglanmao1996 ,
Here are the steps you can follow:
1. Create calculated column.
Rank = LEFT('Table'[Index],1)2. Create measure.
Flag = VAR _SELECT=SELECTEDVALUE('Table2'[Produce]) var _column= MAXX(FILTER(ALL('Table'), 'Table'[Customer]=MAX('Table'[Customer])&&'Table'[Index]=MINX(FILTER(ALL('Table'),'Table'[Customer]=MAX('Table'[Customer])),[Index])),[Product]) RETURN IF( CONTAINSSTRING(_column,_SELECT)=TRUE(),1,0)3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
1 Reply
- AnonymousNot applicable
Hi donglanmao1996 ,
Here are the steps you can follow:
1. Create calculated column.
Rank = LEFT('Table'[Index],1)2. Create measure.
Flag = VAR _SELECT=SELECTEDVALUE('Table2'[Produce]) var _column= MAXX(FILTER(ALL('Table'), 'Table'[Customer]=MAX('Table'[Customer])&&'Table'[Index]=MINX(FILTER(ALL('Table'),'Table'[Customer]=MAX('Table'[Customer])),[Index])),[Product]) RETURN IF( CONTAINSSTRING(_column,_SELECT)=TRUE(),1,0)3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly