Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Solved! Go to Solution.
@ThisIsIt - Tal vez:
DAX Column = IF([Column] = 0,0,[Column]/1000000)
Power Query Column = if [Column] = 0 then 0 else [Column]/1000000
Hola @ThisIsIt
si la longitud del número entero difiere, puede hacerlo con Power Query de la siguiente manera:
// Table
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNjE1M7dQio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Value = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Start([Value],2) & "." & Text.End([Value],Text.Length([Value])-2)),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", type number}})
in
#"Changed Type"
o puedes hacerlo con DAX:
Decimal Number =
CONVERT (
LEFT ( CONVERT ( 'Table (2)'[Value], STRING ), 2 ) & "."
& RIGHT (
CONVERT ( 'Table (2)'[Value], STRING ),
LEN ( CONVERT ( 'Table (2)'[Value], STRING ) ) - 2
),
DOUBLE
)
Una versión más corta de la fórmula DAX anterior es:
Decimal Number =
CONVERT (
LEFT ( 'Table (2)'[Value], 2 ) & "."
& RIGHT (
'Table (2)'[Value],
LEN ('Table (2)'[Value] ) - 2
),
DOUBLE
)
Saludos FrankAT
Gracias a todos por sus respuestas rápidas y sugerencias. Todos trabajan para mí. ¡Realmente lo aprecias!
Haría la siguiente columna calculada.
Decimal column =
VAR __p1 =
LEFT ( 'Table'[Column], 2 )
VAR __p2 =
RIGHT ( 'Table'[Column], LEN ( 'Table'[Column] ) - 2 )
RETURN
__p1 & "." & __p2
Anote editar el nombre de la tabla y el nombre de columna para que se adapten.
@ThisIsIt - Tal vez:
DAX Column = IF([Column] = 0,0,[Column]/1000000)
Power Query Column = if [Column] = 0 then 0 else [Column]/1000000
crear un número como [columna]/1000000 , cambiar el tipo de datos a decimal con 6 decimales
12345678/1000000