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
miltenburger
Helper V
Helper V

New column in direct query Right function

Hi all,

 

I used DirectQuery to get data from a table out of my Kaseya Database.

One of the columns called User contains the following information:

 

abcdefgh\a.klaassen

abcdefgh\b.bass

abcdefgh\c.curry

 

I want to create a new column which contains the following information:

a.klaassen

b.bass

c.curry

 

So basically i want everything that is right from the \ in my column User.

Any idea how to do this?

9 REPLIES 9
vanessafvg
Super User
Super User

@miltenburger

 

 

 

=REPLACE('table'[fieldname],1,9,"")  

https://msdn.microsoft.com/en-us/library/ee634374.aspx





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg

 

Thanks for your fast assist,

but the REPLACE function is not working when adding a new column....

only when i choose the option new measure, but that is not what i want/ and even not works

@miltenburger works fine for me what are you doing?

 

Column = REPLACE(Dates[MonthName],1,3,"")

I took the column monthname and removed the first 3 digits rom january into a new column

 

Capture.PNG

 

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




As @Greg_Deckler mentioned, it's a live connection, which means not all of the DAX functions work

And REPLACE won't work in this case

Hi @miltenburger,

 

Maybe you can try to write a measure to instead, there are lots of limitations when you use calculated column in directquery mode.

BTW, you can also try to add custom column in power query with these operations, but current these function seems not available in directquery mode.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft,

 

Thanks for your answer,

Do you have any idea to write a measure for this? Because i really don't no how to fix this in liveconnection

 

Thanks a lot

HI @miltenburger,

 

I'm not so sure if below measure formula can works in live mode, maybe you can try it:

 

Right Part =
VAR curretn_item =
    LASTNONBLANK ( Table[Column], [Column] )
RETURN
    PATHITEM ( SUBSTITUTE ( curretn_item, "\", "|" ), 2 )

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@miltenburger are you not able to create it in the source data? personally i dont know how you would do that if you doing it in a live connection.   when using live connection power bi expect you do do most of the modelling in the source data.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




It's probably an issue that it is a Live connection and not import. This is why FIND and SEARCH do not work.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.