Forum Discussion
British Summer Time
Hi there,
I recently found some code to help navigate around British Summer Time and after some alterations, the code works great. The code checks to see if the date is between the last Sunday in March and October to return True or False.
When I try to remove the last section that refers to the Year I get an #error so I'm trying to figure out why this is the case as the year (at least to me) is not important and I can't see how it is affecting the output.
So why can I not remove the year statement at the end?
Cheers
Hi Tripp
If you remove the year part in formula,it would not work for all the years in the table.It would only work for the max year in the table.You may have a look at EARLIER function to understand it.Below are some posts for your reference.
https://community.powerbi.com/t5/Desktop/Explanation-of-the-EARLIER-formula/td-p/529469
http://tinylizard.com/dax-earlier-function/
Column = Table1[Date] >= MAXX(FILTER(Table1, Table1[Date].[MonthNo] = 3 && weekday(Table1[Date],2) ),Table1[Date]) && Table1[Date] <= MAXX(FILTER(Table1, Table1[Date].[MonthNo] = 10 && weekday(Table1[Date],2) ), Table1[Date])Regards,
1 Reply
- v-cherch-msft
Microsoft Employee
Hi Tripp
If you remove the year part in formula,it would not work for all the years in the table.It would only work for the max year in the table.You may have a look at EARLIER function to understand it.Below are some posts for your reference.
https://community.powerbi.com/t5/Desktop/Explanation-of-the-EARLIER-formula/td-p/529469
http://tinylizard.com/dax-earlier-function/
Column = Table1[Date] >= MAXX(FILTER(Table1, Table1[Date].[MonthNo] = 3 && weekday(Table1[Date],2) ),Table1[Date]) && Table1[Date] <= MAXX(FILTER(Table1, Table1[Date].[MonthNo] = 10 && weekday(Table1[Date],2) ), Table1[Date])Regards,