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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kivanct
Helper I
Helper I

Abbreviation Solution instead of MID function

Hi everyone,

In order to receive abbreviated version of United States of America, i created the formula below by using MID function.

Do you know any idea to create a short formula, instead of using what i have done below. (Maybe more efficient one)

 

 

IF (
    CONTAINSSTRING ( 'Table 4'[financials_Country], "United States" ),
    COMBINEVALUES (
        ".",
        MID ( 'Table 4'[financials_Country], 1, 1 ),
        MID ( 'Table 4'[financials_Country], 8, 1 ),
        MID ( 'Table 4'[financials_Country], 18, 1 )
    ),



kivanct_0-1675408461165.png

 

Regards...

 

1 REPLY 1
TomMartens
Super User
Super User

Hey @kivanct ,

 

first, I have no better idea.
But instead using DAX I would recommend creating a mapping table (maybe based on Excel), with two columns like financials_country and country_short
Then I would use Power Query's Merge function to merge both tables and get the new column into Table4, as it is a left join cells of this new column might be empty because values are not contained in the mapping table. Finally I would create a new column (also with Power Query) that checks if the first new column is null, in this case take the original country name other wise the value from the new column 1.

Hopefully this provides an idea of how to tackle this challenge.

 

Regards,
Tom  



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.

Top Solution Authors