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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Column with different types of Data

Hello

 

I have a table with different data types in a column.

 

Measure Unit     Value

%10
Days11
'000 USD12
MT13
$ / MT14
# incidents15
Hours16
'000 LC17
000 USD18
'000 $19
%20
Days21
'000 USD22
MT23
$ / MT24
# incidents25
Hours26
'000 LC27
000 USD28
'000 $29
%30
Days31
'000 USD32
MT33
$ / MT34
# incidents35
Hours36
'000 LC37
000 USD38
'000 $39

 

I was thinking in create a new column with the formatted values.
For values with "%", FORMAT solved my problem.

 

Formatted Value = IF(Tab1[Measure Unit]="%";FORMAT(Tab1[Valor];"Percent");FORMAT(Tab1[Valor];"Standard"))

 

But I can't see a solution for others. I tried "Standard"*1000 for the '000 and 000 Measure Units, but didn't work.

 

Suggestions?

 

Thanks in advance

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following code:

 

 

Format =
SWITCH (
    Table1[Measure];
    "%"; FORMAT ( Table1[Value] / 100; "Percent" );
    "000 USD"; FORMAT ( Table1[Value] * 1000; "Currency" )
    //Insert additional formats here 
    FORMAT(Table1[Value];"Standard")
)

 

 

Depending on your currency you may need to adjust for this for example:

 

Format =
SWITCH (
    Table1[Measure];
    "%"; FORMAT ( Table1[Value] / 100; "Percent" );
    "000 USD"; FORMAT ( Table1[Value] * 1000; "$0.000" );
    //Insert additional formats here 
    FORMAT(Table1[Value];"Standard")
)

Just keep adding your columns for each type of format.

 

Insert two lines for each format on the line where is the comment //

Should be as is below.

"%"; FORMAT ( Table1[Value] / 100; "Percent" );
    "000 USD"; FORMAT ( Table1[Value] * 1000; "$0.000" );

Regards,

MFelix

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the following code:

 

 

Format =
SWITCH (
    Table1[Measure];
    "%"; FORMAT ( Table1[Value] / 100; "Percent" );
    "000 USD"; FORMAT ( Table1[Value] * 1000; "Currency" )
    //Insert additional formats here 
    FORMAT(Table1[Value];"Standard")
)

 

 

Depending on your currency you may need to adjust for this for example:

 

Format =
SWITCH (
    Table1[Measure];
    "%"; FORMAT ( Table1[Value] / 100; "Percent" );
    "000 USD"; FORMAT ( Table1[Value] * 1000; "$0.000" );
    //Insert additional formats here 
    FORMAT(Table1[Value];"Standard")
)

Just keep adding your columns for each type of format.

 

Insert two lines for each format on the line where is the comment //

Should be as is below.

"%"; FORMAT ( Table1[Value] / 100; "Percent" );
    "000 USD"; FORMAT ( Table1[Value] * 1000; "$0.000" );

Regards,

MFelix

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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