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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
hassanh2
Helper I
Helper I

Add custom column - query

Hello, I was adding a custom column to my model to map "item code" column to get the for example last 5 digits based on certain prefix in the source column ( using left(Item code column, 5) and in other instances I had to I use "mid" as well as "right" but I got an error message: 'left' name is misspelled!

 

Aren't these (Left, mid and right) not accepted in query of custom column ?

 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

These are valid in DAX not in Power Query. In PQ, following are the equivalents

MID - Text.Middle

RIGHT - Text.End, Text.EndsWith

LEFT - Text.Start, Text.StartsWith

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @hassanh2 

 

DAX and M languages are two different languages in Power BI. They have different functions and syntax. 

Power Query M function reference 

DAX function reference 

 

Can you show your expected result with some dummy data so that we can provide an example solution based on that? 

 

Best Regards,
Community Support Team _ Jing

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

These are valid in DAX not in Power Query. In PQ, following are the equivalents

MID - Text.Middle

RIGHT - Text.End, Text.EndsWith

LEFT - Text.Start, Text.StartsWith

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.