Forum Discussion
RichardT_78
5 years agoHelper I
Time
Hi I have used this code to determine the time difference between rows as a messure. This looks at each row of data. Time Difference Measure13 = VAR NextRow = CALCULATE ( MIN ( FAC[S...
- Anonymous5 years ago
Hello @RichardT_78 ,
You can update your measurement as below screenshot shown, please find more details in the attachment:
Time Difference = VAR _nexindex = CALCULATE ( MIN ( 'FAC'[Index] ), FILTER ( ALLEXCEPT ( 'FAC', 'FAC'[Consist] ), 'FAC'[Index] > MAX ( 'FAC'[Index] ) ) ) VAR _nexttime = CALCULATE ( MAX ( 'FAC'[Start Date/Time] ), FILTER ( ALLEXCEPT ( 'FAC', 'FAC'[Consist] ), 'FAC'[Index] = _nexindex ) ) RETURN DATEDIFF ( SELECTEDVALUE ( 'FAC'[Start Date/Time] ), _nexttime, SECOND ) + 0Best regards
Anonymous
4 years agoNot applicable
Hello,
I am using a crime dataset and trying to put it in a star schema. However, when I merge the dimension table with a fact table it causes the fact table to add additional rows. This dataset has three different date columns and three different time columns. I have tried so many different ways and got the same results. Here is a screenshot of the data model. And the file to the original dataset.
https://data.brla.gov/Public-Safety/Baton-Rouge-Crime-Incidents/pbin-pcm7/data