[英]How to get the delta between two date from the same column ? Power BI
My problem is in the question.我的问题出在问题上。
Here, a picture of my column on Power BI:这是我关于 Power BI 的专栏的图片:
My goal is to have an other column like this:我的目标是有一个这样的专栏:
Is there any way to do this ?有没有办法做到这一点? With Excel this is trivial but I don't know how to do it with Power BI
使用 Excel,这是微不足道的,但我不知道如何使用 Power BI
In order to access the previous row you will need to apply an index column when in query mode.为了访问上一行,您需要在查询模式下应用索引列。 Once you have an index column you will be left with your original datetime column and the index column.
有了索引列后,您将只剩下原始日期时间列和索引列。
If you then move to data view and add in a calculated column, to the pre-existing table, with the following formula:如果您随后移至数据视图并使用以下公式将计算列添加到预先存在的表中:
IF('Table'[Index]=0,0,DATEDIFF('Table'[Column1],LOOKUPVALUE('Table'[Column1],'Table'[Index],
'Table'[Index]-1),MINUTE))
Please replace Column1 with your datetime column, alter the value that says "MINUTE" to the interval that you'd like to see the difference in.请将 Column1 替换为您的日期时间列,将显示“MINUTE”的值更改为您希望查看差异的时间间隔。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.