¿Cómo puedo agregar ceros a la izquierda en Power Query solo si se cumplen determinados criterios? Por ejemplo, tengo una columna donde el número de dígitos puede variar de 10-13, pero todos ellos necesitan ser 13 dígitos. Así que si el campo contiene 10 dígitos, tendría que agregar 3 ceros a la izquierda. Si contenía 11 dígitos, tendría que añadir 2 ceros a la izquierda, etc.
¡Gracias!
Solved! Go to Solution.
@PowerBI123456 , a continuación, se hace referencia a una columna específica en la fórmula
Table.AddColumn(#"Previous step", "Leading 0s", each Number.ToText([number column], Text.Repeat("0",13)))
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! |
DAX is simple, but NOT EASY! |
Si necesita mantenerlos como formato numérico, también puede usar Cadenas de formato personalizado después de cargar los datos.
Usar cadenas de formato personalizado en Power BI Desktop - Power BI Documentos de Microsoft
saludos
palmadita
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hola, @PowerBI123456, es posible que desee seguir este patrón para dar formato a todos los números,
Number.ToText(1234567890, Text.Repeat("0",13))
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL Gracias, ¿qué pasa si quiero hacer referencia a una columna específica?
@PowerBI123456 , a continuación, se hace referencia a una columna específica en la fórmula
Table.AddColumn(#"Previous step", "Leading 0s", each Number.ToText([number column], Text.Repeat("0",13)))
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension! |
DAX is simple, but NOT EASY! |
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |