Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

0

Some Time Intelligence Calculations in Calculated Columns not Working as Expected

Version: 2.66.5376.2161 64-bit (February 2019) AND 

2.66.5376.1681 64-bit (February 2019)

 

Step 1: using "Enter Data" input some dates, example below:

Date

2/22/2019
2/21/2019
2/20/2019
1/15/2019
2/19/2019

1/12/2019

 

Step 2: using "New Column" input the following formula:

PREVIOUSDAY() = PREVIOUSDAY(Table1[Date])
 
Step 3: using "New Column" input the following formula:
DATEADD() = DATEADD(Table1[Date],-1,DAY)
 
Step 4: using "New Column" input the following formula:
-1 = Table1[Date]-1
 
Results:
Date | PREVIOUSDAY() | DATEADD() | -1
2/22/20192/21/20192/21/20192/21/2019
2/21/20192/20/20192/20/20192/20/2019
2/20/20192/19/20192/19/20192/19/2019
1/15/2019  1/14/2019
2/19/2019  2/18/2019
1/12/2019  1/11/2019

 

Why are the blanks appears?

 

On both versions, the Time Intelligence setting "Auto Date/Time" was turned on and off and the results did not change. From my understanding, this did not behave this way prior to Feburary release.

 

Any idea? Lack of understanding maybe?

Status: Delivered
Comments
v-yuezhe-msft
Employee

@timmer ,

In prior versions of Power BI Desktop, both PREVIOUSDAY() and DATEADD() return above results based on your sample data.

PREVIOUSDAY() and DATEADD() requires contiguous date selection, thus why they don't return expected result. You can create a calenda table using dax below.

Table = CALENDAR("1/1/2019","12/31/2019")

Then create the following columns in your original table.
 dateaddcol= DATEADD('Date'[Date],-1,DAY)
previousdaycol= = PREVIOUSDAY('Date'[Date])


Regards,
Lydia

v-yuezhe-msft
Employee
Status changed to: Delivered
 
timmer
New Member

@v-yuezhe-msft  - I was able to reinstall all previous versions of PBI Desktop and prove myself wrong. Thanks for your help.

 

I wasnt able to find anything in Microsoft Docs regarding this requirment.

 

Thanks again for the help!