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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Finding and deleting Types of business entity from organization names

Hi there,

 

I have a list of organizations around the  globe.  Some of them are ended with types of their business entity, e.g. Star LLC, Moon LTD.

 

Is there a smart way to delete these business entities endings?

 

I used the conditional formatting columns, find & replace, the Substitute function. But there should be more sophisticated way to solve it.

 

My challenges are:

 

  • There are more than 30 types of business entities, including variations with commas, dots, spaces. 
  • Most probably, I don't know about all possible options.
  • Sometimes an organization name contains INC e.g., but this is not the business entity, just a part of an organization. I don't  want to replace anything in this case.
  • I want to delete commas, but some organizations contain them as a part of their name.
1 ACCEPTED SOLUTION

@Anonymous

 

I tried to do it with DAX formulas. It is actually depending on your true organization names. I created two tables with following formulas. Please try it in your data. Maybe we cannot get the expected result for a few percent data because of data variations.

I create two tables for my original data.

Finding and deleting Types of business entity from organization names_1.jpg

 

Then I create a new crossjoin table and a new column in it with following formulas.

FullTable =
CROSSJOIN ( Table1, Table2 )
Organizations = 
VAR TempName =
    IF (
        SEARCH ( FullTable[business entity], FullTable[FullCompany],, 0 ) > 0
            && SEARCH ( FullTable[business entity], FullTable[FullCompany],, 0 )
                + LEN ( FullTable[business entity] )
                - 1
                = LEN ( FullTable[FullCompany] ),
        REPLACE (
            FullTable[FullCompany],
            SEARCH ( FullTable[business entity], FullTable[FullCompany],, 0 ),
            LEN ( FullTable[business entity] ),
            ""
        ),
        ""
    )
RETURN
    (
        IF (
            SEARCH ( ",", TempName,, 0 ) = 0,
            TempName,
            IF ( SEARCH ( ",", TempName,, 0 ) = LEN ( TempName ) - 1, "" )
        )
)

Finding and deleting Types of business entity from organization names_2.jpg

 

At last, create another table with following formula.

FinalTable = 
CALCULATETABLE ( FullTable, FullTable[Organizations] <> BLANK () )

Finding and deleting Types of business entity from organization names_3.jpg

 

Best Regards,

Herbert

View solution in original post

6 REPLIES 6
BhaveshPatel
Community Champion
Community Champion

Hi There,

 

You can use powerquery to delete this. If possible, Post the sample file and we can provide you the exact solution.

 

Thanks & Regards,

Bhavesh

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

Bhavesh,

 

Thank you so much!

 

It would be great.

 

I didn't find the way to attach the file but here is the list of endings from my file:

 

, inc.Company , inc.
, incCompany , inc
inc.Company inc.
incCompany inc
, llc.Company , llc.
, llcCompany , llc
llc.Company llc.
llcCompany llc
, ltd.Company , ltd.
, ltdCompany , ltd
ltd.Company ltd.
ltdCompany ltd
, BVCompany , BV
BV.Company BV.
BVCompany BV
ABCompany AB
ASCompany AS
B.V.Company B.V.
GmbhCompany Gmbh
ApSCompany ApS
A/SCompany A/S
K/SCompany K/S
P/SCompany P/S
AyCompany Ay
KyCompany Ky
OyCompany Oy
OyjCompany Oyj
oskCompany osk
AGCompany AG
S.A.R.L.Company S.A.R.L.
nvCompany nv
SàrlCompany Sàrl
PLLCCompany PLLC
corporationCompany corporation
corpCompany corp
corp.Company corp.
incorporatedCompany incorporated
groupCompany group
technologiesCompany technologies
companyCompany company
solutionsCompany solutions
softwareCompany software
EntertainmentCompany Entertainment
ServicesCompany Services
SystemsCompany Systems
AgencyCompany Agency
* * *Company * * *
|Company |
\Company \
/Company /
,Company ,
-Company -
 Company | Some text we need to delete
 Company / fdfw
 TTP  | MACH | The Turning Point
 Test® \ company

 

There are also organizations' names without these endings. They should stay the same.

 

Thank you!

Anonymous
Not applicable

@v-haibl-msft

 

Thank you so much for that detailed plan!

 

I tried to replicate all the steps. But I failed to create the crossjoin table 😞

 

I tried to add the formula as a blank query, It didn't work. Where in Power BI editor should I add this? 

 

I found this article, https://blog.crossjoin.co.uk/2016/06/03/creating-tables-in-power-bipower-query-m-code-using-table/

 

Here is the screenshot: http://i.imgur.com/SaaT5NR.png

@Anonymous

 

Please first close and apply Query Editor, I'm not using Power Query here. You can use DAX formula like below.

 

Finding and deleting Types of business entity from organization names_4.jpg

 

Best Regards,

Herbert

Anonymous
Not applicable

@v-haibl-msft

 

Thank you! I'll try asap and write  how did go.  I am sorry for my slow replies. It is very hectic for me now. I do appreciate your help! Thank you so much 🙂

@Anonymous

 

I tried to do it with DAX formulas. It is actually depending on your true organization names. I created two tables with following formulas. Please try it in your data. Maybe we cannot get the expected result for a few percent data because of data variations.

I create two tables for my original data.

Finding and deleting Types of business entity from organization names_1.jpg

 

Then I create a new crossjoin table and a new column in it with following formulas.

FullTable =
CROSSJOIN ( Table1, Table2 )
Organizations = 
VAR TempName =
    IF (
        SEARCH ( FullTable[business entity], FullTable[FullCompany],, 0 ) > 0
            && SEARCH ( FullTable[business entity], FullTable[FullCompany],, 0 )
                + LEN ( FullTable[business entity] )
                - 1
                = LEN ( FullTable[FullCompany] ),
        REPLACE (
            FullTable[FullCompany],
            SEARCH ( FullTable[business entity], FullTable[FullCompany],, 0 ),
            LEN ( FullTable[business entity] ),
            ""
        ),
        ""
    )
RETURN
    (
        IF (
            SEARCH ( ",", TempName,, 0 ) = 0,
            TempName,
            IF ( SEARCH ( ",", TempName,, 0 ) = LEN ( TempName ) - 1, "" )
        )
)

Finding and deleting Types of business entity from organization names_2.jpg

 

At last, create another table with following formula.

FinalTable = 
CALCULATETABLE ( FullTable, FullTable[Organizations] <> BLANK () )

Finding and deleting Types of business entity from organization names_3.jpg

 

Best Regards,

Herbert

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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