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
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors