数据源:
任意数据源
目标:
设置适合的数据类型
操作过程:
选取指定列》【主页】》【数据类型】》选取
选取指定列》【转换】》【数据类型】》选取
单击列标题左侧的【数据类型】按钮选取
M公式:
= Table.TransformColumnTypes(步骤名,{"列名", 指定类型})
= Table.TransformColumnTypes(步骤名,{{"列名1", 指定类型1}, {"列名2", 指定类型2},... {"列名n", 指定类型n}})
指定类型:
小数:type number
货币:Currency.Type
整数:Int64.Type
百分比:Percentage.Type
日期/时间:type datetime
日期:type date
时间:type time
日期/时间/时区:type datetimezone
持续时间:type duration
文本:type text
逻辑值:type logical
二进制:type binary
最终效果:
如图
官网资料:
https://docs.microsoft.com/zh-cn/powerquery-m/table-transformcolumntypes
设置数据类型Table.TransformColumnTypes(Power Query 之 M 语言)
原文:https://www.cnblogs.com/officeplayer/p/14826457.html