Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Solved! Go to Solution.
@ThisIsIt - Perhaps:
DAX Column = IF([Column] = 0,0,[Column]/1000000)
Power Query Column = if [Column] = 0 then 0 else [Column]/1000000
Hi @ThisIsIt
if the length of the whole number differs you can do it with Power Query like this:
// 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"
or you can do it with 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
)
A shorter version of the above DAX formula is:
Decimal Number =
CONVERT (
LEFT ( 'Table (2)'[Value], 2 ) & "."
& RIGHT (
'Table (2)'[Value],
LEN ('Table (2)'[Value] ) - 2
),
DOUBLE
)
Regards FrankAT
Thank you all for you quick replies and suggestions. They all work for me. Really appreicate it!
@ThisIsIt - Perhaps:
DAX Column = IF([Column] = 0,0,[Column]/1000000)
Power Query Column = if [Column] = 0 then 0 else [Column]/1000000
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |