Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a list of serial codes that I want to pull individual characters out of that relate to a date made. For instance I want the third digit (7) out of CH78KG092 to put into a new column because that corresponds to the year made (2017). In excel I use a mid function. How to do in power BI? Thanks.
Solved! Go to Solution.
There are a couple different functions that you can use, one being Text.Middle.
Below is how that function works, but you can always use the following link to play around with other functions:
https://msdn.microsoft.com/en-us/query-bi/m/power-query-m-function-reference
Text.Middle(text as nullable text, start as number, optional count as nullable number) as nullable text
Returns count characters, or through the end of text; at the offset start.
Find the substring from the text "Hello World" starting at index 6 spanning 5 characters.
Text.Middle("Hello World", 6, 5)
Equals: "World"
DAX has MID( ) as well
M Code also has similar Text.Middle( )
Proud to be a Super User!
There are a couple different functions that you can use, one being Text.Middle.
Below is how that function works, but you can always use the following link to play around with other functions:
https://msdn.microsoft.com/en-us/query-bi/m/power-query-m-function-reference
Text.Middle(text as nullable text, start as number, optional count as nullable number) as nullable text
Returns count characters, or through the end of text; at the offset start.
Find the substring from the text "Hello World" starting at index 6 spanning 5 characters.
Text.Middle("Hello World", 6, 5)
Equals: "World"
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
72 | |
68 | |
41 | |
35 |
User | Count |
---|---|
108 | |
56 | |
52 | |
48 | |
41 |