Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all, I'm trying to create logic for a new column Customer Type:
Customer Type classification -> Indoor, Outdoor, Both
Please note that I want to ignore all customers with Status that does contain the text "Actual"
| Customer | Status | Product type | Customer Type (desired column) |
| A | Test | Indoor | Outdoor |
| A | Actual1 | Outdoor | Outdoor |
| A | Actual2 | Outdoor | Outdoor |
| B | Actual1 | Indoor | Indoor |
| B | Test | Indoor | Indoor |
| B | Actual2 | Indoor | Indoor |
| C | Actual1 | Outdoor | Both |
| C | Actual2 | Both | |
| C | Actual 3 | Indoor | Both |
Could someone help me figure out how to implement this logic in a new column? Thanks!
Solved! Go to Solution.
@Anonymous try something like this, add this as a column
Ask anything Power BI. Book appointment for a free consultancy at https://www.perytus.com
Customer Type =
VAR __indoor =
COUNTROWS(
CALCULATETABLE(
VALUES ( Customer[Product type] ),
ALLEXCEPT ( Customer, Customer[Customer] ),
Customer[Product type] = "Indoor" ,
CONTAINSSTRING( Customer[Status] , "Actual" )
)
)
VAR __outdoor =COUNTROWS(
CALCULATETABLE(
VALUES ( Customer[Product type] ),
ALLEXCEPT ( Customer, Customer[Customer] ),
Customer[Product type] = "Outdoor" ,
CONTAINSSTRING( Customer[Status] , "Actual" )
)
)
RETURN
SWITCH ( TRUE(),
__indoor = 1 && __outdoor = 1, "Both",
__indoor = 1, "Indoor",
__outdoor = 1, "Outdoor"
)
Would appreciate Kudos 🙂 if my solution helped.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous try something like this, add this as a column
Ask anything Power BI. Book appointment for a free consultancy at https://www.perytus.com
Customer Type =
VAR __indoor =
COUNTROWS(
CALCULATETABLE(
VALUES ( Customer[Product type] ),
ALLEXCEPT ( Customer, Customer[Customer] ),
Customer[Product type] = "Indoor" ,
CONTAINSSTRING( Customer[Status] , "Actual" )
)
)
VAR __outdoor =COUNTROWS(
CALCULATETABLE(
VALUES ( Customer[Product type] ),
ALLEXCEPT ( Customer, Customer[Customer] ),
Customer[Product type] = "Outdoor" ,
CONTAINSSTRING( Customer[Status] , "Actual" )
)
)
RETURN
SWITCH ( TRUE(),
__indoor = 1 && __outdoor = 1, "Both",
__indoor = 1, "Indoor",
__outdoor = 1, "Outdoor"
)
Would appreciate Kudos 🙂 if my solution helped.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous customer A suppose to be Both, isnt it?
Ask anything Power BI. Book appointment for a free consultancy at https://www.perytus.com
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k no, I want to ignore where status = Test, I only want to look at where Status contains the text "Actual"
Hi @Anonymous ,
Try this code:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.