Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
Looking to calculate the first day of the current month but in the previous year in a dax measure. So if ran today it would give me 5/1/2020.
Thanks in advanced
Solved! Go to Solution.
Hi @Anonymous
If you have a 'Date' table and you're wanting to create a date filter, you can write this:
SAMEPERIODLASTYEAR ( STARTOFMONTH ( TREATAS ( { TODAY () }, 'Date'[Date] ) ) )
If you instead need the date as a scalar, you could write something like this:
EOMONTH ( TODAY(), -13 ) + 1
Regards,
Owen
Time intelligence functions and time functions are totoally different,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @Anonymous
If you have a 'Date' table and you're wanting to create a date filter, you can write this:
SAMEPERIODLASTYEAR ( STARTOFMONTH ( TREATAS ( { TODAY () }, 'Date'[Date] ) ) )
If you instead need the date as a scalar, you could write something like this:
EOMONTH ( TODAY(), -13 ) + 1
Regards,
Owen
Thank you! Just what I needed as I needed the date as a scalar.
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |