USERELATIONSHIP function can only use the two columns references participating in relationship

Bai*_*l P 4 dax powerbi

I am trying to create measures which use different date columns within the same table. I have an order date and a shipment date. I want to compare how many orders are received on each week day with the amount of orders that are shipped on each weekday. I have a separate DATE table and I am using the 'USERELATIONSHIP' function in DAX. This is the main orders table:

在此输入图像描述

As you can see, there are two columns with order date and ship date. This is the DATE table:

在此输入图像描述

The relationship between these tables is by default, between the 'Order Date' column and 'DATE[Date]' table/column. This is the formula I have where I use the USERELATIONSHIP function:

Shipped-volumes = CALCULATE(COUNTROWS('DIM-Order'), USERELATIONSHIP('DIM-Order'[Ship Date], 'DATE'[Date]))
Run Code Online (Sandbox Code Playgroud)

I am receiving the error message:

'USERELATIONSHIP function can only use the two columns references participating in relationship.'

Any ideas why?

小智 8

为了使用 USERRELATIONSHIP 函数,您需要在“DIM-Order”[发货日期] 和“DATE”[日期] 之间创建非活动关系。

访问: https: //www.sqlbi.com/articles/using-userrelationship-in-dax/