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 All,
Can some one suggest a DAX by which i can extract year,month and day from a date say '01-Jan-2021' from dates column and then substract 100 from it.
For eg: I want to extract the numeric value 20210101 from the date '01-Jan-2021 and minus 100 from it using DAX query.
Expected output:
100- 20210101 = -20210001
Please suggest.
Solved! Go to Solution.
Hi @deb_power123 !
You can create a new column based on following DAX;
NewColumn = 100 - (YEAR(Table[Date]) & LEFT("0" & MONTH(Table[Date]), 2) & LEFT("0" & DAY(Table[Date]), 2))
Hope this will resolve your issue.
Regards,
Hasham
Hi @deb_power123 !
You can create a new column based on following DAX;
NewColumn = 100 - (YEAR(Table[Date]) & LEFT("0" & MONTH(Table[Date]), 2) & LEFT("0" & DAY(Table[Date]), 2))
Hope this will resolve your issue.
Regards,
Hasham
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |