Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TabathaN
Advocate II
Advocate II

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"
)

 





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

Proud to be a Super User!




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"
)

 





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.