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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Joaquim_Guedes
Frequent Visitor

Column Format With Different Data Type

Hello everyone!

I have this table that have a column woth different data type (currency, percentage, date, etc.). How to format this column in power bi?

The tables is the follwing:

Teste  Data Type

250     Currency

0,05    Percentage

15 -11-2022 Date

Thank you for your help.

 

Best regards.

 

Joaquim Guedes

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Joaquim_Guedes ;

Yes, a column can only set one number type, if you want the display to be different, you can use the format function in dax. Like what:

Column = 
var _num=CONVERT([Teste ],DOUBLE)
return 
 IF(CONTAINSSTRING([Teste ],"-")=FALSE(),
IF( _num<1,FORMAT(_num,"0.00%"),FORMAT(_num,"Currency")),
[Teste ])

The final show:

vyalanwumsft_0-1668579733068.png

however this column is text type, if you want convert to number or percent,you could create a measure by If().


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yalanwu-msft
Community Support
Community Support

Hi, @Joaquim_Guedes ;

Yes, a column can only set one number type, if you want the display to be different, you can use the format function in dax. Like what:

Column = 
var _num=CONVERT([Teste ],DOUBLE)
return 
 IF(CONTAINSSTRING([Teste ],"-")=FALSE(),
IF( _num<1,FORMAT(_num,"0.00%"),FORMAT(_num,"Currency")),
[Teste ])

The final show:

vyalanwumsft_0-1668579733068.png

however this column is text type, if you want convert to number or percent,you could create a measure by If().


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have multiples tables, with multiple columns. How can I transform the following table

Table 1

 

Kpi       Value

Kpi 1   0,35

Kpi2   44860

Kpi3   150

Kpi4   1050

 to this table

Table 2

Kpi      Value

Kpi1    35%

Kpi2    26-10-2022

Kpi3   150,00€

Kpi4  1.050,00

 

Do I have to create a measure or a column to solve this problem? I have mutiple tables and columns with this situation. I can't chage data format in the data source files. Thank for your help.

Beste regards.

 

Joaquim Guedes

Hello!

Thank you very much for your help!

That solution solves the problem, but I have another situation to solve. If i have a in the Teste column a number to transform in date format? How to turn the problem around? Thank you for the help.

 

Best regards.

 

Joaquim Guedes

AntrikshSharma
Community Champion
Community Champion

@Joaquim_Guedes Why do you need a mix of different data types in one column?

Hello @AntrikshSharma!I have multiple indicators in a table and each indicator has different data type!

Ok, but you can't have multiple data types in a single column, it will work in PowerQuery, but once loaded in the data model it will be text in your case.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors