admin管理员组文章数量:1023744
I have a column with multiple data type in Power BI as the following below. How I can convert/modify to Currency ( Fixed decimal number)
old_price
null 990 SR 4,040 SR 50/4 pack SR 445/2 pack null 895 SR 50/4 pack ......
I tried some of ways below
- replace value
- Added Custom column with formular: Convert, Number.From text However, it did not work and get error message
I would like to convert this mixed data into Fixed decimal number
I have a column with multiple data type in Power BI as the following below. How I can convert/modify to Currency ( Fixed decimal number)
old_price
null 990 SR 4,040 SR 50/4 pack SR 445/2 pack null 895 SR 50/4 pack ......
I tried some of ways below
- replace value
- Added Custom column with formular: Convert, Number.From text However, it did not work and get error message
I would like to convert this mixed data into Fixed decimal number
Share Improve this question asked Nov 19, 2024 at 8:44 Tran NhungTran Nhung 31 bronze badge1 Answer
Reset to default 0Having a mixed type column is generally a very bad idea. You could use something like that:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
TransformColumn = Table.TransformColumns(
Source,
{
{"Column1", each if Value.Is(_, type number) then Number.ToText(_, "C") else _}
}
)
in
TransformColumn
Number.ToText(_, "C")
- is used to format string as currency.
I have a column with multiple data type in Power BI as the following below. How I can convert/modify to Currency ( Fixed decimal number)
old_price
null 990 SR 4,040 SR 50/4 pack SR 445/2 pack null 895 SR 50/4 pack ......
I tried some of ways below
- replace value
- Added Custom column with formular: Convert, Number.From text However, it did not work and get error message
I would like to convert this mixed data into Fixed decimal number
I have a column with multiple data type in Power BI as the following below. How I can convert/modify to Currency ( Fixed decimal number)
old_price
null 990 SR 4,040 SR 50/4 pack SR 445/2 pack null 895 SR 50/4 pack ......
I tried some of ways below
- replace value
- Added Custom column with formular: Convert, Number.From text However, it did not work and get error message
I would like to convert this mixed data into Fixed decimal number
Share Improve this question asked Nov 19, 2024 at 8:44 Tran NhungTran Nhung 31 bronze badge1 Answer
Reset to default 0Having a mixed type column is generally a very bad idea. You could use something like that:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
TransformColumn = Table.TransformColumns(
Source,
{
{"Column1", each if Value.Is(_, type number) then Number.ToText(_, "C") else _}
}
)
in
TransformColumn
Number.ToText(_, "C")
- is used to format string as currency.
本文标签: powerbiMultiple data type column in Power QueryStack Overflow
版权声明:本文标题:powerbi - Multiple data type column in Power Query - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745573157a2156859.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论