Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have text in a column "Outline_Number" I want to extract some of the text based on the length of the string to a new column "Outline_Parent"
i.e. I want the whole string minus the last 2 characters, this would be easy in excel but i'm relatively new to BI.
"Outline_Number" = 1.1.2.2.4
Result
"Outline_Parent" = 1.1.2.2
Thanks
Alex
Text.Combine(List.RemoveLastN(Text.ToList(txt), 2))
You may use this
Text.Start([Outline_Number],Text.Length([Outline_Number])-2)
If you have string less than 2 in length
then
try Text.Start([Outline_Number],Text.Length([Outline_Number])-2) otherwise null
The first version worked but as expected gives an error on short string, the 2nd version gives a syntax error on the "otherwise null"
User | Count |
---|---|
9 | |
8 | |
6 | |
6 | |
6 |