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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.