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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
darylmc
Frequent Visitor

Función Excel TEXT - equivalente en DAX

Hola a todos

Estoy buscando replicar en DAX para asegurarme de que una columna de cadena tenga al menos 4 caracteres. ¿Cuál es la función para lograr esto?

Gracias de antemano

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

Utilice M, en el modo transformar datos

https://docs.microsoft.com/en-us/powerquery-m/text-format

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

MFelix
Super User
Super User

Hola @darylmc,

En DAX:
FORMAT(TABLE[COLUMN], "0000")

En el editor de consultas:
Text.PadStart (columna, 4, 0)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hola @darylmc,

En DAX:
FORMAT(TABLE[COLUMN], "0000")

En el editor de consultas:
Text.PadStart (columna, 4, 0)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

Utilice M, en el modo transformar datos

https://docs.microsoft.com/en-us/powerquery-m/text-format

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Utilice la función FORMAT.

Mejor
D
Anonymous
Not applicable

Tenemos la función len para comprobar la longitud de la cadena.
Nueva columna-if(len(table[oldcolumn])<4,blank(),table[oldcolumn])

O también puede hacer esto en la consulta de energía

Si Text.Length([Projekt_ID]) <4 entonces "" else [project_id]

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors