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
guys i have a start time end an end
i calculate it right but there some wrong entries like the end time before the start and the results show in negative
in the datedif i want to make he negative result as blank how can i do it
Solved! Go to Solution.
Hi @abodqmm
You can modify your formula to below:
=
VAR __DIFF =
DATEDIFF ( 'TableName'[start_time], 'TableName'[end_time], MINUTE )
RETURN
IF ( __DIFF < 0, BLANK (), __DIFF )
My question now is why would the difference return negative values? Shouldn't the end always be later than the start? You might need to include in your calculation the dates as well.
Hello @abodqmm ,
try the following
Column =
var diff = DATEDIFF('TableName'[start_time],'TableName'[end_time],MINUTE)
RETURN
IF(diff < 0,BLANK(),diff)
Proud to be a Super User! | |
Hello @abodqmm ,
try the following
Column =
var diff = DATEDIFF('TableName'[start_time],'TableName'[end_time],MINUTE)
RETURN
IF(diff < 0,BLANK(),diff)
Proud to be a Super User! | |
Hi @abodqmm
You can modify your formula to below:
=
VAR __DIFF =
DATEDIFF ( 'TableName'[start_time], 'TableName'[end_time], MINUTE )
RETURN
IF ( __DIFF < 0, BLANK (), __DIFF )
My question now is why would the difference return negative values? Shouldn't the end always be later than the start? You might need to include in your calculation the dates as well.
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 |
|---|---|
| 36 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 40 | |
| 33 | |
| 24 | |
| 23 |