DAX 创建具有特定列名且没有行的空表 [英] DAX create empty table with specific column names and no rows

查看:7
本文介绍了DAX 创建具有特定列名且没有行的空表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建具有指定列名且根本没有行的表.下面的 oneliner 做了我想要的,但显示了 ROW 函数中应该有第二个参数的错误消息.

How to create a table with a specified column name and no rows at all. The following oneliner does what I want but shows error message that there should be second argument in ROW function.

EmptyTable = ROW ("Product")

我想用它来制作具有所需列名的桥表.例如,我希望 Product_bridge 表有一个产品"列.

I would like to use it for making bridge tables with desired column name. For example I want Product_bridge table to have a column "Product".

Product_bridge = DISTINCT(
    UNION(
         DISTINCT(      Sales[Prod_Name]        ) 
        ,DISTINCT( Dictionary[Prod_DifferntName])
        ,DISTINCT(  PriceList[P]                )
        ))

上面的代码让我得到第一个表的名称,在本例中为 Prod_Name.

The code above gets me the name of the first table, in this case Prod_Name.

推荐答案

你可以过滤它.或者选择TOPN 0.

You could just filter it. Or select TOPN 0.

顶部:

Table = TOPN(0;DATATABLE("Product";STRING;{{}}))

过滤器:

Table = FILTER(DATATABLE("Product";STRING;{{}});0)

这篇关于DAX 创建具有特定列名且没有行的空表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆