简体   繁体   English

如何从同一列中获取两个日期之间的增量? 商业智能

[英]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.

相关问题 计算 Power BI 中同一列的两个给定值之间的百分比差异 - Calculate Percentage Difference between two given values from the same column in Power BI POWER BI - 如何在没有日期变量的情况下计算增量值? - POWER BI - How to calculate delta values without a date variable? 如何在 Power BI 中将同一列的两个值相乘? - How to multiply two values of a same column in Power BI? 如何在power bi中从UTC日期时间获取日期? - How to get Date from UTC Date time in power bi? 如何从 Power BI 中的两行计算添加新列? - How to add new column from calculation on two rows in power BI? 如何从 POWER BI DAX 中的表达式获取日期列表 - How get a list of date from an expression in POWER BI DAX 如何从Power BI中具有条件的同一列中查找DateDiff - How to find DateDiff from same column with condition in Power BI Power BI IF 介于 2 次和两个日期之间,然后日期,否则另一个日期 - Power BI IF Between 2 Times & Two Dates Then Date Otherwise Another Date 在Power BI中的不同列上从同一列中减去两行 - Subtracting two rows from same column with condition on different column in Power BI 如何使用 Power Bi 中的 Power Query 编辑器从两列的不同值的选择中创建新列 - How to create a new column from the select of the distinct values of two columns with Power Query Editor in Power Bi
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM