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

Next 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

Reply
SKey
Regular Visitor

What Data Type - multi decimal data.

Hi there,

 

I have a data source containing numbers separated by multiple decimal places. This is important as this is the format which we use in other systems. 

 

My issue is I am not sure what data type to use to store this information.

 

The Data might look like this;

2.2

2.2

2.3

2.3

2.3.6.1

2.3.6.2

2.4

 

When I use data type decimal it comes out like this;

2.2

2.2

2.3

2.3

Error

Error

2.4

 

Using Text comes out like this;

2.2

2.2

2.99988888888888

2.99988888888888

2.3.6.1

2.3.6.2

2.3999989879

 

Can anyone advise on which data type I should be using for this? 

 

Thanks in advance.

 

Simon

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@SKey,

 

Try this Power Query solution. The concept is to determine if the original value is number or text; if number, round to the appropriate number of decimal places, otherwise return the original value.

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText("i45WMtIzUorVAdHGaLQJjK9npmeIxAaqjwUA", BinaryEncoding.Base64), 
        Compression.Deflate
      )
    ), 
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [#"Original Column" = _t]
  ), 
  AddDataTypeColumn = Table.AddColumn(
    Source, 
    "Data Type", 
    each 
      let
        result     = try Number.From([Original Column]) otherwise "Text", 
        resultType = if result = "Text" then "Text" else "Number"
      in
        resultType
  ), 
  AddNewColumn = Table.AddColumn(
    AddDataTypeColumn, 
    "New Column", 
    each 
      if [Data Type] = "Number" then
        Number.Round(Number.FromText([Original Column]), 1)
      else
        [Original Column]
  ), 
  ChangeType = Table.TransformColumnTypes(AddNewColumn, {{"New Column", type text}})
in
  ChangeType

 

DataInsights_0-1715614821054.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@SKey,

 

Try this Power Query solution. The concept is to determine if the original value is number or text; if number, round to the appropriate number of decimal places, otherwise return the original value.

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText("i45WMtIzUorVAdHGaLQJjK9npmeIxAaqjwUA", BinaryEncoding.Base64), 
        Compression.Deflate
      )
    ), 
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [#"Original Column" = _t]
  ), 
  AddDataTypeColumn = Table.AddColumn(
    Source, 
    "Data Type", 
    each 
      let
        result     = try Number.From([Original Column]) otherwise "Text", 
        resultType = if result = "Text" then "Text" else "Number"
      in
        resultType
  ), 
  AddNewColumn = Table.AddColumn(
    AddDataTypeColumn, 
    "New Column", 
    each 
      if [Data Type] = "Number" then
        Number.Round(Number.FromText([Original Column]), 1)
      else
        [Original Column]
  ), 
  ChangeType = Table.TransformColumnTypes(AddNewColumn, {{"New Column", type text}})
in
  ChangeType

 

DataInsights_0-1715614821054.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@DataInsights 

 

I'll give this a try and reply with my findings, if you don't mind. Thanks for the possible solution. 

 

Simon

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.