日期栏中的度量值 [英] Cant measure from date column

查看:80
本文介绍了日期栏中的度量值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试计算"completionDate"列中的日期与今天之间的天数

I'm trying to count days between a date from the column 'completionDate' and today

表名称为事件(2)"

The table name is 'Incidents (2)'

我有一个名为'incidents'的模拟器表,在这里工作.

I have a simuler table called 'incidents' here it's working.

代码: DaysClosed = DATEDIFF('Incidents(2)'[completionDate].[Dag]; TODAY(); DAY)

我得到的错误:无法确定表'Incidents(2)'中'completionDate'列的'variaton'Dag'的单个值.当度量公式引用包含许多值的列而未指定诸如最小值,最大值,计数或总和之类的聚合以获得单个结果时,就会发生这种情况.'

The error i get: 'A single value for variaton 'Dag' for column 'completionDate' in table 'Incidents (2)' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.'

推荐答案

事件(2)" [completionDate].[Dag]引用列.它是在您的计算中返回一个表(在评估上下文中为多个日期),以代替DATEDIFF计算中所需的标量.

'Incidents (2)'[completionDate].[Dag] referencing a colomn. It is in your computation returning a table (multiple date in the evaluation context) instade of a scalar needed in DATEDIFF calculation.

您需要利用杠杆作用来确保'Incidents(2)'[completionDate].[Dag]正在返回标量值.为此,您可以利用rowcontext,然后再利用Max等公式.

You need to leverage to be sure that 'Incidents (2)'[completionDate].[Dag] is rturning a scalar value. To do that you can leverage rowcontext and then also formula like Max.

这篇关于日期栏中的度量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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