Forum Discussion

Let-Me-Know's avatar
Let-Me-Know
Frequent Visitor
3 years ago

Implementing Time Criteria in DAX formula (AddColumn)

Hi everyone!

I have to refine a formula which has already been established (by someone else), by adding time dimension in it.

 

So, I have to determine new parameters for outcome "Suspect":

- for values in Column "Date" which are before Jan 1st 2023 parameter for Value should be 100 and parameter for TimeDifference should be same (10) and

- for values in Column "Date" which are on or after Jan 1st 2023 parameter for Value should be 50 and parameter for TimeDifference should be same (10)

 

The formula which has to be refined is this one:

= Table.AddColumn(#"Add Alert X", "Alert Y", each if [TimeDifference]=null then "Not reported" else ( if [TimeDifference]<10 and [Value]<100 then "Suspect" else "OK"))

 

Also, part of formula stating #"Add Alert X" - does it mean that the new column which we are creating (Alert Y) comes AFTER the column Alert X?

 

Thank you in advance!