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 there,
I'm new to DAX and am looking for a way to say whether a given date is in the current quarter or the previous 4 quarters. I came across a formula that one of our former consultants developed and modified it a bit to get the results I am looking for, but I'm having trouble deciphering how it works and if it will continue to give me the results I'm looking for in the future. Can someone help me understand all the moving parts in this formula:?
=IF(
CONCATENATE(YEAR(TODAY()),ROUNDUP(MONTH(TODAY())/3,0)) - CONCATENATE('Date'[Year],'Date'[CalendarQuarterNumber]) <=10
&& CONCATENATE(YEAR(TODAY()),ROUNDUP(MONTH(TODAY())/3,0)) - CONCATENATE('Date'[Year],'Date'[CalendarQuarterNumber]) >=0,
"Yes",
"No"
)
Thank you!
Solved! Go to Solution.
In this formula, "ROUNDUP(MONTH(TODAY())/3
When you have that "Year-Quarter" minus the Year+QuartNumber in your table row, if the number if less than 10 and greater than 0, it means the date is within previous 4 quarters of TODAY(). For exmaple, today is "20172", you can get dates between "20162" and "20172".
Regards,
Regards,
In this formula, "ROUNDUP(MONTH(TODAY())/3
When you have that "Year-Quarter" minus the Year+QuartNumber in your table row, if the number if less than 10 and greater than 0, it means the date is within previous 4 quarters of TODAY(). For exmaple, today is "20172", you can get dates between "20162" and "20172".
Regards,
Regards,
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |