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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors