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.
Hi all!
I need help with a dax function for last year data. I am using this function to calculate, for example, the revenue.
Hello @Anonymous,
Have you tried using the DATESYTD function?
Instead of DATEADD('TableDates [Date]'[date]; -1; YEAR), you can use:
DATESYTD ( 'TableDates [Date]'[Date] )
More info: https://docs.microsoft.com/en-us/dax/datesytd-function-dax
Also, your table naming ('TableDates [Date]') is quite confusing as it has square brackets which are normally used for column notation.
Hope this helps!
Alex
Thanks for your answer Alex,
In this case we have several dates table so we have this names in brackes to know which one we have to use, just a name.
I have seen that DATESYTD https://dax.guide/datesytd/ function will sum all the values in the year, but I need to compare year and year-1 in two lines., gettin the same value in 201829 tan 201929 - Previous year. I have uploaded the question with an example.
@Anonymous wrote:Hello @Anonymous,
Have you tried using the DATESYTD function?
Instead of DATEADD('TableDates [Date]'[date]; -1; YEAR), you can use:
DATESYTD ( 'TableDates [Date]'[Date] )More info: https://docs.microsoft.com/en-us/dax/datesytd-function-dax
Also, your table naming ('TableDates [Date]') is quite confusing as it has square brackets which are normally used for column notation.
Hope this helps!
Alex
Hey,
this article
https://www.daxpatterns.com/time-patterns/
will provide additional hints how to find the "exact" same timeframe in the past, of course one has to decide how leap years have to be handles.
Regards,
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |