March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Need help to convert the following below tableau calculation into dax
IF [Renewal Date] >= DATE(STR(DATEPART('year',[HighDateValue Max]))+'-'+STR(1)+'-'+STR(1))
AND [Renewal Date] <= DATE(STR(DATEPART('year',[HighDateValue Max]))+'-'+STR(3)+'-'+STR(31)) THEN '1 Jan - 31 Mar'
END
Renewal Date - date (Datatype)
HighDateValue Max - date (Datatype)
First line - DATE(STR(DATEPART('year',[HighDateValue Max]))+'-'+STR(1)+'-'+STR(1))
Output - 01-01-2016 01-01-2017 01-01-2018 01-01-2019 01-01-2020 01-01-2021 01-01-2022
Second line - DATE(STR(DATEPART('year',[HighDateValue Max]))+'-'+STR(3)+'-'+STR(31))
Output - 31-03-2016 31-03-2017 31-03-2018 31-03-2019 31-03-2020 31-03-2021 31-03-2022
IF([Renewal Date] >= DATE(YEAR(HighDateValue[Max])+'-'&TEXT(DAY(HighDateValue[Max])+1)+'-'&TEXT(MONTH(HighDateValue[Max])+1))
AND [Renewal Date] <= DATE(YEAR(HighDateValue[Max])+'-'&TEXT(DAY(HighDateValue[Max])+3)+'-'&TEXT(MONTH(HighDateValue[Max])+3)))
THEN "1 Jan - 31 Mar"
END
Hi @Dragpunk ,
For first Line DATE(STR(DATEPART('year',[HighDateValue Max]))+'-'+STR(1)+'-'+STR(1)), you can use below DAX :
DATE(YEAR('Date Data'[HighDateValue Max ].[Date]), "1","1")
For Second Line DATE(STR(DATEPART('year',[HighDateValue Max]))+'-'+STR(1)+'-'+STR(1)), you can use below DAX:
DATE(YEAR('Date Data'[HighDateValue Max ].[Date]), "3","31")
And overall column can have below DAX expression:
DAX Result = IF('Date Data'[Renewal Date ].[Date] >= DATE(YEAR('Date Data'[HighDateValue Max ].[Date]), "1","1") && 'Date Data'[Renewal Date ].[Date] <= DATE(YEAR('Date Data'[HighDateValue Max ].[Date]), "3","31"), "1 Jan - 31 Mar")
This will give you below result for sample renewal date and HighDateValue Max,
If this answer helps, please mark it as an Accepted Solution so it would help others to find the solution.
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |