Forum Discussion
elatreille
Helper I
9 years agoToday()-1 vs Today()-2
Hi all, I need to display in a column graph data from 2 days and yesterday. So the chart will easilly show the 2 days trend. I used this in Power BI desktop and it works well but when gets time...
- 9 years ago
You could also create measures as shown below.
Yesterday = SUMX ( FILTER ( AdvRev, AdvRev[Date] = MAX ( AdvRev[Date] ) - 1 ), AdvRev[Total impressions] )Two_Days = SUMX ( FILTER ( AdvRev, AdvRev[Date] = MAX ( AdvRev[Date] ) - 2 ), AdvRev[Total impressions] )
GilbertQ
Super User
9 years agoHi there,
What about if you change your measure from TODAY() to use DATEADD
Here is an example:
Yesterday = CALCULATE(SUM('AdvRev'[Total impressions]),DATEADD('Calendar'[Date],-1, DAY))elatreille
Helper I
9 years agoBoth ways works for yesterday but not working for 2 daus ago so if I replace -1 by -2 for 2 days before, it returns the same numbers from yesterday.