Forum Discussion
Time Intelligence DAX
- 4 years ago
Hi Anonymous
You can add a calculated column to your table using this code
Status =
VAR CurrentTime=TIME(HOUR(NOW());MINUTE(NOW());SECOND(NOW()))
Return IF(AND(CurrentTime>='Table'[IN];CurrentTime<'Table'[OUT]);"Occupied";"Available")Did it work ? 👌Mark it as a solution to help spreading knowledge 👉A kudos would be appreciated
- 4 years ago
Hi Anonymous ,
In order for this to be refreshable in a browser, you will need a calculated measure as opposed to a column. Columns are refreshed with the dataset and not dynamically.
Try the code below:Current Time = Time(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW())) Status = IF(AND([Current Time]>=FIRSTNONBLANK(Test[In],1),[Current Time]<=FIRSTNONBLANK(Test[Out],1)),"Occupied", "Available")This can be refreshed using the refresh button in broswer window or on report load.
Ignore the 1 hour current time difference in my example as it's a setting in the service.
Hi Anonymous ,
In order for this to be refreshable in a browser, you will need a calculated measure as opposed to a column. Columns are refreshed with the dataset and not dynamically.
Try the code below:
Current Time = Time(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
Status = IF(AND([Current Time]>=FIRSTNONBLANK(Test[In],1),[Current Time]<=FIRSTNONBLANK(Test[Out],1)),"Occupied", "Available")
This can be refreshed using the refresh button in broswer window or on report load.
Ignore the 1 hour current time difference in my example as it's a setting in the service.
- Anonymous4 years agoNot applicable
Upto to IN 14:00:00 and OUT 23:00:00 it working fine. But when it coming for IN 15:00:00 and OUT 24:00:00 onwords its not working.