missing value in a column using DATEADD function in dax power bi

340 Views Asked by At

enter image description here

is anybody knows why the second cell in previousdate column is empty and how I can solve this?

It how it works with PREVOUSQUARTER function: enter image description here

2

There are 2 best solutions below

0
Pieter On

What if you use DATEADD() instead? I think the reason you're not seeing some values is that those dates are not in your calendar table.

0
Sia On

1. Create a new table:

Calendar 2 = CALENDAR(DATE(2021,1,1),LASTDATE('Calendar'[Data]))

2. Set relationship between two tables in MODEL view:

enter image description here

3. Calculate previousdate:

previousdate = DATEADD('Calendar 2'[Date],-1,QUARTER)

enter image description here