首页 > 解决方案 > 在 PowerBI 中添加具有硬编码值的列

问题描述

这可能非常简单,但我找不到答案。我创建了一个新列,我想使用 DAX 语法用硬编码值填充该列。

我可以这样写:Column = 10我会得到一列 10s 但假设我的表有 3 行,我想插入一列[10, 17, 155]。我怎样才能做到这一点?

标签: powerbidax

解决方案


Try using DATATABLE function

Table = DATATABLE("Column Name",INTEGER,{{10},{17},{155}})

You can also put more columns with their own data if you want to, check this https://docs.microsoft.com/en-us/dax/datatable-function


推荐阅读