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
kunal_mehta1
Helper I
Helper I

DAX For Creating Column - Power BI

Hi All,
I am trying to create a calculated column in a calculated table, where i have the data as follows:
Project Number

O1234
O2345
O3456
I want to create a new column where i would have the same last 4 digits but starting with letter "C" in the same table.
For example,

Project Number     C Project Number

O1234                      C1234
O2345                      C2345
O3456                      C3456


Can someone please help me with this query.
Thanks.

1 REPLY 1
tackytechtom
Super User
Super User

Hi @kunal_mehta1 ,

 

How about this:

tackytechtom_0-1680583508108.png

 

 

And here the code in DAX for a calculated column:

CalcColumn = 
"C" & RIGHT ( 'Table'[Project Number], 4 )

 

Probably DAX is not the right tool for this task since it appears you are trying to cleanse the data. Consider doing such things in Power Query instead if that suits your approach. I can help you with that as well if you like.

 

Let me know 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

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.