Forum Discussion
Comparison function with if in Dax
Good afternoon,
I am trying to compare values between today's date and yesterday's date. And I want to create an alert where it decreases and where it increases from yesterday to today. But I can not get into the Dax function. Anyone have suggestions?
Column1 = IF(TODAY()-1 > TODAY(),"+","-")
Column2 = IF([value_flt_base], TODAY()-1 >[value_flt_base], TODAY(),"+","-")
Thanks
I'm using it as a solution:
SUMX (
FILTER (QL2_Alerts, QL2_Alerts[dtt_data_captura] = MAX (QL2_Alerts[dtt_data_captura])),
QL2_Alerts[flt_base])
10 Replies
- AnonymousNot applicable
I do not understand what you're trying to do with these formulas.
TODAY() - 1 will give you yesterday's date. So Column1 will always return "-" because yesterday's date is never greater than today's date.
Your Column2 is an IF statement with 5 arguments. The IF formula takes 3 arguments: IF(<condition to check>, <result if condition is true>, <result if condition is false>)
What does this table even look like? How would you compare one date's value to today's? Is there a date column? I'm not even sure this should be a column. This sounds like the sort of thing that should be a measure but it's very unclear from your examples.
- sakamotothaisHelper III
I have three columns.
The Date, Place and Value
I want to compare the Value of yesterday's date d-1 with the value of today's date d0,
to check if there was an increase or decrease between yesterday and today.
In which localities there was increase and which localities had reduction.
Local Date Value Brazil 20170621 174.52 EUA 20170620 157.66 EUA 20170621 487.69 Brazil 20170620 497.65 Thanks
- AnonymousNot applicable
Do you have a date table?