Forum Discussion
Problems with PREVIOUSDAY
Hello!
I have a project in which I have a table of the current month ("mes_curso"), where daily information is added, and another table where I consolidated the previous months with the current ("Unified").
The idea is to have, by day, the pending records, and the pending of the previous day. With this I'll do other calculations later.
Table 1 is designed with "mes_curso" data, and has the exact output I'm waiting for. Instead, Table 2 is designed with "Unified" data, and yet the field pend_ant not show me what was expected. It should be noted that the tables have exactly the same filters applied, except that I applied filter to Table 2 in Date to be able to compare.
In Table 1, pend_ant has the following syntax
What may be failing in Table 2?
Thanks a lot!
Syndicate_Admin , I doubt table 2 might have timestamp for few dates
Create a date like
Date = [Fecha_anterior].date
or
Date = date(year([Fecha_anterior]),month([Fecha_anterior]),day([Fecha_anterior]))Also it better to use Date table for time intelligence // assuming you are creating a measure
[Tabpend_ante] - CALCULATE(COUNT(Unified[Description]),PREVIOUSDAY(Date[Date]))
2 Replies
- amitchandakSuper User
Syndicate_Admin , I doubt table 2 might have timestamp for few dates
Create a date like
Date = [Fecha_anterior].date
or
Date = date(year([Fecha_anterior]),month([Fecha_anterior]),day([Fecha_anterior]))Also it better to use Date table for time intelligence // assuming you are creating a measure
[Tabpend_ante] - CALCULATE(COUNT(Unified[Description]),PREVIOUSDAY(Date[Date]))
- Syndicate_AdminAdministrator
Thanks a lot.
I don't know what was going on, because Fecha_anterior was as a date.
I solved it by creating a Calendar table, Fecha_anterior to Calendar.