Forum Discussion
Logical IF with overlapping condition
Hi all, I am struggling with this dax measure in my table. The result I want is
1. Last quarter
2. Current quarter
3. 5 quarters (this include current quarter and next 4 quarters --> How do I achieve this?)
4. Others
This is my code...
5 Replies
- v-yingjl
Community Support
Hi alienlin ,
Maybe the measure is like this? I have modified the locgic about "Last Quarter" and "5 Quarters"
DateRange = IF ( ( QUARTER ( TODAY () ) - QUARTER ( 'Milestones'[End_Date] ) = 1 && YEAR ( TODAY () ) = YEAR ( 'Milestones'[End_Date] ) ) || ( QUARTER ( TODAY () ) - QUARTER ( 'Milestones'[End_Date] ) = -3 && YEAR ( TODAY () ) - YEAR ( 'Milestones'[End_Date] ) = 1 ), "Last Quarter", IF ( QUARTER ( TODAY () ) = QUARTER ( 'Milestones'[End_Date] ) && YEAR ( TODAY () ) = YEAR ( 'Milestones'[End_Date] ), "Current Quarter", IF ( QUARTER ( TODAY () ) = QUARTER ( 'Milestones'[End_Date] ) && YEAR ( TODAY () ) - YEAR ( 'Milestones'[End_Date] ) = -1, "5 Quarters", "Others" ) ) )Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- v-yingjl
Community Support
Hi alienlin ,
Since '5 quarters' includes 'Current quarter' and the next 4 quarters. It means the same quarter but just next year right? How can the 'Current Quarter' will be lost? It should work.
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.