The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi
I have a table that shows when were our machines data updated in format:
09.10.2020 08:10:22
Now I need a new column that shows hold old this is from now. Since it's 8:51 o'clock atm it should give me value:
00:41:15
Tried this but it gives me wrong values:
Diff = DATEDIFF(TODAY(),'POS LaneCurrentState'[LastTransactionDate],MINUTE)
@Anonymous ,
Try like
Diff = DATEDIFF(Now(),'POS LaneCurrentState'[LastTransactionDate],MINUTE)
or
Diff = DATEDIFF('POS LaneCurrentState'[LastTransactionDate],Now(),MINUTE)
Thanks this gives me answer in minutes that I can work with but I also need to be able to do this in M code now.
Tried:
Duration.ToText(DateTime.FixedLocalNow - [LastTransactionDate])
but that doesn't work either:
Expression.Error: We cannot apply operator - to types Function and DateTime.
Details:
Operator=-
Left=[Function]
Right=09.10.2020 08:19:19
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
11 | |
10 | |
7 |