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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors