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.
Hello
I would like to identify if a date falls within DST (daylight saving) or not.
This works fine in excel
IF(AND(SysDate[SysDate]>=DATE(YEAR(SysDate[SysDate]),3,1)+14-WEEKDAY(DATE(YEAR(SysDate[SysDate]),3,1)-1), SysDate[SysDate] < DATE(YEAR(SysDate[SysDate]),11,1)+7-WEEKDAY(DATE(YEAR(SysDate[SysDate]),11,1)-1)),"DST","No")
Can anyone please help me to write this in power query
I know that the commas need to go and I need to put then and els
But I think I cannot use the syntax I am using to return the date for the second sunday in march and 1st sunday in november
Regards
Swati
Solved! Go to Solution.
@svishwanathan wrote:
Hello
I would like to identify if a date falls within DST (daylight saving) or not.
This works fine in excel
IF(AND(SysDate[SysDate]>=DATE(YEAR(SysDate[SysDate]),3,1)+14-WEEKDAY(DATE(YEAR(SysDate[SysDate]),3,1)-1), SysDate[SysDate] < DATE(YEAR(SysDate[SysDate]),11,1)+7-WEEKDAY(DATE(YEAR(SysDate[SysDate]),11,1)-1)),"DST","No")
Can anyone please help me to write this in power query
I know that the commas need to go and I need to put then and els
But I think I cannot use the syntax I am using to return the date for the second sunday in march and 1st sunday in november
Regards
Swati
It doesn't have to use Power Query, in DAX, the formula is the same. Any reason why not using DAX?
dstDayOrNot = IF( AND( SysDate[SysDate] >= DATE( YEAR( SysDate[SysDate] ), 3, 1 ) + 14 - WEEKDAY( DATE( YEAR( SysDate[SysDate] ), 3, 1 ) - 1 ), SysDate[SysDate] < DATE( YEAR( SysDate[SysDate] ), 11, 1 ) + 7 - WEEKDAY( DATE( YEAR( SysDate[SysDate] ), 11, 1 ) - 1 ) ), "DST", "No" )
@svishwanathan wrote:
Hello
I would like to identify if a date falls within DST (daylight saving) or not.
This works fine in excel
IF(AND(SysDate[SysDate]>=DATE(YEAR(SysDate[SysDate]),3,1)+14-WEEKDAY(DATE(YEAR(SysDate[SysDate]),3,1)-1), SysDate[SysDate] < DATE(YEAR(SysDate[SysDate]),11,1)+7-WEEKDAY(DATE(YEAR(SysDate[SysDate]),11,1)-1)),"DST","No")
Can anyone please help me to write this in power query
I know that the commas need to go and I need to put then and els
But I think I cannot use the syntax I am using to return the date for the second sunday in march and 1st sunday in november
Regards
Swati
It doesn't have to use Power Query, in DAX, the formula is the same. Any reason why not using DAX?
dstDayOrNot = IF( AND( SysDate[SysDate] >= DATE( YEAR( SysDate[SysDate] ), 3, 1 ) + 14 - WEEKDAY( DATE( YEAR( SysDate[SysDate] ), 3, 1 ) - 1 ), SysDate[SysDate] < DATE( YEAR( SysDate[SysDate] ), 11, 1 ) + 7 - WEEKDAY( DATE( YEAR( SysDate[SysDate] ), 11, 1 ) - 1 ) ), "DST", "No" )
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
38 | |
28 | |
26 |
User | Count |
---|---|
99 | |
87 | |
45 | |
43 | |
35 |