Forum Discussion

Oded-Dror's avatar
Oded-Dror
Helper III
2 years ago

Time interval

Hi there,
See image below.

In the left I have SQL Server table called example with two ID's  And DTTM columns.
I need it to capture 15 running min interval with reseting the loop (every 15 min set to 0 again)
In the middle I have a view I created which use TSQL with CTE first part grouping (anchor )
Second part the looping and reseting - 15 min time interval
Final part presenting the resultset

I've tried to translate TSQL to DAX but it produces wrong results
Any help will be much appriciated.

Thanks,
Oded Dror

20 Replies

  • To help you better, I would need to understand the logic you've implemented in T-SQL and see the DAX formula you've attempted. Unfortunately, the text in the image is not clear enough to read the details of the code. If you could type out the T-SQL query and the DAX formula you've tried, I could then provide more specific advice on how to correct the DAX formula.

    Remember, in DAX, there is no direct equivalent of a CTE. Instead, you would use calculated columns, measures, or variables to achieve similar results. Moreover, the concept of "looping" in DAX doesn't work the same way as in T-SQL. You would typically use DAX time intelligence functions, filters, and iterators like CALCULATE, FILTER, and the X functions (like SUMX, AVERAGEX...) to perform row context and filter context operations over the data.