saafiyah
saafiyah

Reputation: 19

How do i exclude negative numbers in DAX query PowerBI

Column = DATEDIFF ([MailingDate], [MeetingDate], Minute)

How do i exclude negative numbers to avoid inaccurate Average Times.

Upvotes: 0

Views: 4035

Answers (1)

Andrey Nikolov
Andrey Nikolov

Reputation: 13440

After calculating the difference, you can assign the result to a variable and check is it negative or not. Like this:

Column =
VAR diff = DATEDIFF([MailingDate], [MeetingDate], MINUTE)
RETURN IF(diff < 0, BLANK(), diff)

diff will contain the difference (as in your calculation). Then the IF function will check is it negative (returning blank value in this case) or not (returning the original value).

Upvotes: 2

Related Questions