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.

Reply
IdoiaPerez
New Member

DATEADD ERROR

Hola expertos,

 

¿Puede alguien ser capaz de guiarme cómo solucionar este problema, por favor?

IdoiaPerez_0-1672395240300.png

Mi código DAX es este: 

_Mes anterior_Recuento usuarios = calculate (([_Recuento usuarios]),  DATEADD (usuarios[Fecha alta], -1, MONTH))
 
El resultado en DASHBOARD es este: IdoiaPerez_1-1672395325950.png, pero cuando lo quiero filtrar es cuando me da el dateadd error.
 
Lo he intentado corregir cambiando el DATEADD (usuarios[Fecha alta], -1, MONTH)) por 
DATEADD (_Calendario[Fecha].[Date], -1, MONTH)), pero el resultado no es el esperado ya que me sale esto: IdoiaPerez_2-1672395426305.png, no me llega a hacer la comparativa con el mes anterior y no sé donde puede estar el error. 

 

 
Gracias de antemano.
Idoia Pérez. 
3 REPLIES 3
v-xinruzhu-msft
Community Support
Community Support

Hi @IdoiaPerez 

You can refer to the following links:

Solved: Dateadd - Microsoft Power BI Community

Solved: DATEADD DAX FUNCTION - Microsoft Power BI Community

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FreemanZ
Super User
Super User

hi @IdoiaPerez 

DATEADD is a Time Intelligence  function. Always reference the date column from a qualified Date Table in Time Intelligence functions.

amitchandak
Super User
Super User

@IdoiaPerez , dateadd need continous dates, so it can error if they are not

to add days, simple add to date

[Date] +20

 

for year and month use date

add 10 month

date(year([Date]) , month([Date])+10, day([Date]) )

 

Dateadd and its Alternate: https://www.youtube.com/watch?v=9qiRivlBv8w&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=66

 

Date as Dateadd
https://community.powerbi.com/t5/Community-Blog/Date-as-Dateadd-Decoding-Date-and-Calendar-5-5-Power...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors