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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Mukombo
Regular Visitor

Replace a value in a new calculated column

Hello guys,

I have a couple of columns I have created using this formula:

County = LOOKUPVALUE (
    'organisation units'[org unit],
    'organisation units'[org unit Id],
    PATHITEM ( 'organisation units'[Path],3))
and it is returning the correct value. From the data source, which I cannot change, the text contains another value that I do not want to show in the final text. Kindly help me with how I can solve this.
 
Thanks
2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Anonymous
Not applicable

Hi @Mukombo ,

 

Judging from the screenshots you provided, it's easy to remove County. You only need to modify it as follows

County =
VAR tt =
    LOOKUPVALUE (
        'organisation units'[org unit],
        'organisation units'[org unit Id], PATHITEM ( 'organisation units'[Path], 3 )
    )
RETURN
    LEFT ( tt, LEN ( tt ) - 6 )

 

Or create a new calculated column like

NewCounty =
LEFT ( [County], LEN ( County ) - 6 )

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish,

Though it did not solve my issue from the explanation in the document. But i learned new ideas from the same.

Dear Ashish, Thank you for reaching out. See the screenshot below. What i do not want is the "County" to appear in the text.

PowerBI.PNG

 

Anonymous
Not applicable

Hi @Mukombo ,

 

Judging from the screenshots you provided, it's easy to remove County. You only need to modify it as follows

County =
VAR tt =
    LOOKUPVALUE (
        'organisation units'[org unit],
        'organisation units'[org unit Id], PATHITEM ( 'organisation units'[Path], 3 )
    )
RETURN
    LEFT ( tt, LEN ( tt ) - 6 )

 

Or create a new calculated column like

NewCounty =
LEFT ( [County], LEN ( County ) - 6 )

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hey Stephen, this was very helpful. thanks a million!

Hi,

Please use the SUBSTITUTE function - SUBSTITUTE function (DAX)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors