This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I want to return the seconds starting the count from 07:00am without restarting the count after every 60 seconds
So the results should look like this
Solved! Go to Solution.
Check this one..
I just used time default time as 7:50:10 to test the Dax code. You can change it to 7:00:00
_Counter =
var _defaultime = TIME(7,50,10)
return
IF('Table'[Time] >_defaultime,
DATEDIFF(_defaultime,'Table'[Time],SECOND),
BLANK()
)
Hi @Anonymous ,
Since there are multiple conditions based on time 07:00:00(>, < , =), and you used DATEDIFF() twice with the same experssion, you could use a variable and SWITCH() to simplify the syntax:
_Counter =
VAR _defaultime = TIME (7, 00, 00 )
VAR _diff = DATEDIFF ( _defaultime, muchData_MultipleBelts[Time], SECOND )
RETURN SWITCH (TRUE (),[Time] > _defaultime, _diff,[Time] < _defaultime,( 60 * 60 * 24 ) + _diff,BLANK ())
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check this one..
I just used time default time as 7:50:10 to test the Dax code. You can change it to 7:00:00
_Counter =
var _defaultime = TIME(7,50,10)
return
IF('Table'[Time] >_defaultime,
DATEDIFF(_defaultime,'Table'[Time],SECOND),
BLANK()
)
I changed your dax code so at 00:00:00 the count of seconds continue untill 7:00:00
_Counter =
var _defaultime = TIME(7,00,00)
return
IF(muchData_MultipleBelts[Time] >_defaultime,
DATEDIFF(_defaultime,muchData_MultipleBelts[Time],SECOND),
IF(muchData_MultipleBelts[Time] < _defaultime,
(60*60*24) + DATEDIFF(_defaultime, muchData_MultipleBelts[Time], SECOND),
BLANK()
))
Can you check if its correct? I mean it works but maybe there is a better way
Hi, Looks good.
@Anonymous create this calculated column and make it a whole number / decimal number date type:
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 22 | |
| 22 |