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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply

Añadir espacio múltiple al principio de la columna que tiene valores de texto

Necesito agregar algunos espacios al principio de la columna y esa columna tiene valores de texto.

Creo que esto es técnica y lógicamente posible, pero por qué no está funcionando en power bi.

option1:in power query editor , creó una columna personalizada;

if Text.Length([vdo_nm])<30 then (Text.PadStart([vdo_nm],30-Text.Length([vdo_nm])," "))
Más
[vdo_nm]

que no funcionan en el informe final.

Opción 2: Se ha creado una nueva columna con dax

(" " & app_strm_cntnt_chnl_pgm_mnth_agg[vdo_nm])

No está funcionando también.

¿Alguna idea de cómo resolver?

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Funciona - se puede ver en la vista de tabla. Pero las imágenes recortan el principio. Utilice el carácter de espacio de no separación160 en su lugar.

Text.Length([vdo_nm])<30 then (Text.PadStart([vdo_nm],30-Text.Length([vdo_nm]),Character.FromNumber(160))



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

4 REPLIES 4
edhans
Super User
Super User

Funciona - se puede ver en la vista de tabla. Pero las imágenes recortan el principio. Utilice el carácter de espacio de no separación160 en su lugar.

Text.Length([vdo_nm])<30 then (Text.PadStart([vdo_nm],30-Text.Length([vdo_nm]),Character.FromNumber(160))



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

si la longitud de un texto es 12, entonces agregará 30-12-18 espacios.

¿Es realmente un espacio o algo más?

No es un espacio, que es ASCII 32. Es un espacio de no separación, pero ocupa el mismo ancho. En la imagen de abajo, esto es 30 del código 160 espacios antes del carácter "FR". La columna "Personalizado" es casi el ancho de esta imagen, por lo que puede ver que está permitiendo que el "espacio" permanezca.

2020-06-04 16_38_30-Untitled - Power BI Desktop.png

Pruébalo. Simplemente reemplace " " en su código con Character.FromNumber(60).

Tenga en cuenta que debido a que los espacios de kerning no tienen el mismo ancho a menos que cambie la fuente a un ancho fijo, como Courier New.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
parry2k
Super User
Super User

@saktisahoo2006 debería funcionar, en el primer método, intente agregar otros caracteres y ver si se rellena con el carácter. ¿Tiene un paso después de que esté limpiando o recortando la columna?



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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors