Forum Discussion
Yuiitsu
Helper V
6 years agoCreating new column with custom grouping
Hi Experts I would like to create a new column to group my customer base on certain rules. Please take a look at the example I created below Customer Item Purchased AAA GT BBB GT ...
- 6 years ago
Hi, Yuiitsu
Based on your description, you may create a meausre or a column as follows.
Result = var _customer = SELECTEDVALUE('Table'[Customer]) return IF( ISFILTERED('Table'[Customer]), IF( _customer in {"AAA","BBB"}, _customer, "others" ) ) Result Column = IF( 'Table'[Customer] in {"AAA","BBB"}, 'Table'[Customer], "others" )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
6 years agoTry a new column
New column = switch( true(),
[customer] = "AAA", "AAA",
[customer] = "BBB", "BBB",
"Others"
)
Also check : https://radacad.com/grouping-and-binning-step-towards-better-data-visualization