Forum Discussion
Comparison function with if in Dax
- 9 years ago
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])
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
Do you have a date table?
- sakamotothais9 years agoHelper III
Yes I have
dtt_date 6/20/2017 6/20/2017 6/20/2017 6/20/2017 6/21/2017 6/21/2017 6/21/2017 6/21/2017 - sakamotothais9 years agoHelper III
I want to use a Dax calculation that checks the variance by selecting yesterday's date and today's date in the result, which increased and decreased.
- Anonymous9 years agoNot applicable
This measure would return the difference between one day and the previous day. Not literally today and yesterday unless you give it today's date from the date table, but any 2 day period based on the date from your date table.
Daily Variance = SUM(TableName[Value]) - CALCULATE( DATEADD(DateTable[dtt_date], -1, day) )