Skip to main content
|

PowerPivotPro's FAQ Site

Go Search
  
PowerPivotPro's FAQ Site > The Great PowerPivot FAQ > The Time intelligence functions does not return results  

The Great PowerPivot FAQ: The Time intelligence functions does not return results

Title

The Time intelligence functions does not return results 

Answer

When using Time intelligence functions like LASTDATE or DATESMTD it is necessary to add another argument which is ALL (TimeTable). Without this, only the selected dates are considered.
 
Example:
=CALCULATE(sum(‘FactInternetSales’[OrderQuantity]),DATESYTD(PREVIOUSYEAR(‘DimDate’[FullDateAlternateKey])),ALL(‘DimDate’))
This gives the ytd of the previous year.
You could also add separate time table which you can relate to your other tables, use a date column to create the relationship. When you do this the additional argument isn't necessary.

Client/Server

Client 

Topic

F - Calculations (DAX) 

Purpose

Troubleshooting 

Answered?

Yes 

Contributor

Kasper de Jonge 

Título

As funções de tempo não retornam os resultados esperados (CTP) 

Resposta

Quanto se está usando funções de tempo (Time) inteligentes como LASTDATE ou DATESMTD, no CTP3, é necessário adicionar outro argumento que é o ALL (TabelaTempo) ( ALL (TimeTable)). Isto não será necessário após o CTP3. Sem isto, apenas as datas selecionadas são consideradas.
 
Exemplo:
=CALCULATE(sum(‘FactInternetSales’[OrderQuantity]),DATESYTD(PREVIOUSYEAR(‘DimDate’[FullDateAlternateKey])),ALL(‘DimDate’))
Isto resulta no ydt do ano anterior.

Frage

Die DAX "Time Intelligence functions" liefern keine Ergebnisse! 

Antwort

 

preRTM

 
Attachments
Created at 1/2/2010 1:50 PM  by Kasper de Jonge 
Last modified at 4/23/2010 1:24 PM  by Jochen Juelke