Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I need to add some spaces at the beginning of the column and that column has text values.
I believe this is technically and logically possible but why it is not working in power bi.
option1:in power query editor , created a custom column ;
if Text.Length([vdo_nm])<30 then (Text.PadStart([vdo_nm],30-Text.Length([vdo_nm])," "))
else
[vdo_nm]
which des not work in final report.
Option2: Created a new column using dax
(" " & app_strm_cntnt_chnl_pgm_mnth_agg[vdo_nm])
It is not working also.
Any idea how to solve?
Solved! Go to Solution.
It works - you can see it in the table view. But the visuals effectivly trim the beginning. Use the non-breaking space160 char instead.
Text.Length([vdo_nm])<30 then (Text.PadStart([vdo_nm],30-Text.Length([vdo_nm]),Character.FromNumber(160))
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingIt works - you can see it in the table view. But the visuals effectivly trim the beginning. Use the non-breaking space160 char instead.
Text.Length([vdo_nm])<30 then (Text.PadStart([vdo_nm],30-Text.Length([vdo_nm]),Character.FromNumber(160))
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reportingif the length of a text is 12, then will it add 30-12=18 spaces .
Is that really a space or something else?
It is not a space, which is ASCII 32. It is a non-breaking space, but it takes up the same width. In the image below, this is 30 of the code 160 spaces before the "FR" character. The "Custom" column is nearly the width of this image, so you can see it is allowing the "space" to remain.
Try it. Just replace " " in your code with Character.FromNumber(60).
Note that due to kerning spaces are not the same width unless you are changing your font to fixed width, like Courier New.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting@saktisahoo2006 it should work, in the first method, try to add other characters and see if it pad with the character. Do you have step after that is cleaning or trimming the column?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |