有2种方法
1.在小于10的月份前,人为加了个0
monthformat2 =
IF ( 'Table'[Month] < 10, "0" & 'Table'[Month], CONVERT ( [Month], STRING ) )
- 将月份数字的显示格式修改了,显示为01,实际上还是1
monthformat =
FORMAT ( INT ( 'Table'[Month] ), "0#" )
dax格式相关参考:
https://www.xspdf.com/resolution/52666397.html
https://community.powerbi.com/t5/Desktop/How-to-format-text-in-PoewrBI/m-p/399628#M182477
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings
https://community.powerbi.com/t5/Desktop/Expressions-that-yield-variant-data-type-cannot-be-used-to/m-p/332281