Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have item column that item column contain text & number. The item column conatin the sapce after the text(item).
I would like to know the no of spaces added after the text.
Item | Desired Result (No Space) |
12345 | 0 |
12345 | 1 |
12345-001 | 1 |
456 | 3 |
345 | 2 |
124-pkds | 1 |
124-001iv | 0 |
12345 | 0 |
435678 | 0 |
Solved! Go to Solution.
Hi @Saxon10
This will work in Power Query. Create a new column with this code. A full sample query is in the file above.
= Table.AddColumn(Source, "Num Spaces", each Text.Length([Item]) - Text.Length(Text.Trim([Item])))
Regards
Phil
Proud to be a Super User!
Hi @Saxon10
Create a Calculated Column with this
NumSpaces = LEN([Item])-LEN(TRIM([Item]))
Regards
Phil
Proud to be a Super User!
Hi @Saxon10
Create a Calculated Column with this
NumSpaces = LEN([Item])-LEN(TRIM([Item]))
Regards
Phil
Proud to be a Super User!
Hi @Saxon10
This will work in Power Query. Create a new column with this code. A full sample query is in the file above.
= Table.AddColumn(Source, "Num Spaces", each Text.Length([Item]) - Text.Length(Text.Trim([Item])))
Regards
Phil
Proud to be a Super User!
Hi,
Thank you so much for your help and sorry for the late reply. Your solution is working very well.
Thanks for your quick reply.
I would like to achieve the same result by using DAX Measure and New calculated column.
Can you please advise.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
75 | |
63 | |
51 | |
48 |
User | Count |
---|---|
211 | |
86 | |
64 | |
59 | |
56 |