cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply

I want to convert decimal digits to percentage in a column that has multiple data types in Power BI.

I want to convert decimal digits to percentage in a column that has multiple data types in Power BI. How do I achieve this using query/measure in Power BI?  

Note: I want all the values in a single column as expected in output example is that possible to create?

 

Input data: Data type of the column: Any

Ayush_tiwari08_0-1676387951391.png

OUTPUT I AM EXPECTING 

Ayush_tiwari08_1-1676387998968.png

 

3 REPLIES 3
Ahmedx
Super User
Super User

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText(
          "i45WMlCK1YlWMgKTJmDSL1/BsaAgJzM5MSknFYeIgY6xqTmUZWBgaQETNDE1U4qNBQA=", 
          BinaryEncoding.Base64
        ), 
        Compression.Deflate
      )
    ), 
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [Column1 = _t]
  ), 
  typCh = Table.TransformColumnTypes(Source, {{"Column1", type text}}), 
  Fx = (x) =>
    if Text.Contains(x, "0,") then
      Text.From(Value.Add((Number.FromText(x) * 100), 0, Precision.Decimal)) & " %"
    else
      x, 
  Result = Table.TransformColumns(typCh, {"Column1", Fx})
in
  Result


Sample PBIX file attached
https://dropmefiles.com/3LCjD

Hi the file link which you have shared is not working.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors