Forum Discussion
How to minus the Date/Time format ?
Hi All,
I created in table Dim Date an calculated column called GetTime. This GetTime ( formula Gettime = NOW() ) gives a current time from my PowerBI Desktop.
The current time is now at 13:36 and i want to make a measure that calculate the GetTime minus the roo_ID number 1 from another table Fact WaitingRoom.
So the expected output when i choose/filter the roo_id number 1 is : 13:36 minus 4 minutes which result 13:32.
Which formula should i use to calculate this? Thanks in advances.
Hi Anonymous,
You can try this formula in your scenario.
ResultMeasure = MIN ( 'Table1'[GetTimeCol] ) + SIGN ( MIN ( 'Table1'[Time] ) ) * TIME ( 0, ABS ( MIN ( 'Table1'[Time] ) ), 0 )I would suggest that we create a calculated column instead, which would be simpler.
ResultCol = [GetTimeCol] + SIGN ( [Time] ) * TIME ( 0, ABS ( [Time] ), 0 )Best Regards!
Dale
5 Replies
- v-jiascu-msft
Microsoft Employee
Hi Anonymous,
Could you please mark the proper answer as solution or share the answer if it's convenient for you? That will be a help to the others.
Best Regards!
Dale - vanessafvg
Community Champion
Anonymous not sure if this would work but you could try
column =
NOW () + time (0, 4,0)- AnonymousNot applicable
Thanks for your response. Your formula works perfect when we have a delay of 4 minutes on some waiting room.
But what if we have a early estimated time of -4 minutes? How can i calculate this?
- vanessafvg
Community Champion
i am not sure would that be held in your rootid?
- v-jiascu-msft
Microsoft Employee
Hi Anonymous,
You can try this formula in your scenario.
ResultMeasure = MIN ( 'Table1'[GetTimeCol] ) + SIGN ( MIN ( 'Table1'[Time] ) ) * TIME ( 0, ABS ( MIN ( 'Table1'[Time] ) ), 0 )I would suggest that we create a calculated column instead, which would be simpler.
ResultCol = [GetTimeCol] + SIGN ( [Time] ) * TIME ( 0, ABS ( [Time] ), 0 )Best Regards!
Dale