Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 |
AAA | AT |
CCC | AT |
CCC | FT |
DDD | GT |
DDD | GT |
AAA | HT |
CCC | HT |
I want the rule to be like this:
New column= if customer = AAA = "AAA",
if customer = BBB = "BBB"
anything else will be grouped as "others"
Can anyone tell me how to set this formula?
Let me know if my request is confusing.
Thanks!
Solved! Go to Solution.
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.
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.
Hi Experts
I found out that I could just right click the column and add new group.
It is so much easier!
Thanks alot for all the info guys!
Try 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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
80 | |
60 | |
35 | |
35 |
User | Count |
---|---|
100 | |
62 | |
56 | |
47 | |
41 |