cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TabathaN
Advocate I
Advocate I

Grouping an EXACT Match

Hello,

 

I have a formula, below, that groups data based on provider ID. The actual formula is quite long and contains multiple groupings like this. The issue I'm having is that if there is another provider, lets say....who's number is 337, that provider will also show in this grouping because of a partial match to the "37". How can I change this formula so it only pulls exact matches?

 

Supervising Provider Team =
IF (
    SEARCH ( "37", Transactions[Supervising Provider ID],, -1 ) > -1
        || SEARCH ( "115", Transactions[Supervising Provider ID],, -1 ) > -1
        || SEARCH ( "74", Transactions[Supervising Provider ID],, -1 ) > -1,
    "Team Byrd",
    "Error - Contact Tabatha"
)
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@TabathaN, try this calculated column:

 

Supervising Provider Team = 
SWITCH (
    TRUE (),
    Transactions[Supervising Provider ID] IN { 37, 115, 74 }, "Team Byrd",
    Transactions[Supervising Provider ID] IN { 38, 116, 75 }, "Team X",
    "Error - Contact Tabatha"
)

 

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @TabathaN ,

 

If you need to pull exact matches,use below dax expression:

Supervising Provider Team = 
SWITCH (
    TRUE (),
    Transactions[Supervising Provider ID] IN { 37, 115, 74 }, "Team Byrd",
    "Error - Contact Tabatha"
)

 I made a sample,see below:

Screenshot 2020-09-28 164653.png

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

DataInsights
Super User
Super User

@TabathaN, try this calculated column:

 

Supervising Provider Team = 
SWITCH (
    TRUE (),
    Transactions[Supervising Provider ID] IN { 37, 115, 74 }, "Team Byrd",
    Transactions[Supervising Provider ID] IN { 38, 116, 75 }, "Team X",
    "Error - Contact Tabatha"
)

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.