Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I'm trying to creat PYTD in Power Query because the typical formula is not working in a calculated column. The data set I am using only has dates for the first day of the quarter, and last day of the quarter for each year, no dates inbetween. This is the formula I am trying to use in power query but its just giving me errors. Anyone got any ideas?
PYTD = if Date.IsInYearToDate([quarter] {Date.AddYears([quarter], -1)})
then [channel_licenses_net_added] else 0
Solved! Go to Solution.
Hi @CiaraCaryl , you haven't specified expected output. What about this one?
let
Source = Table.FromColumns({List.Transform({3,6,9,12}, each Date.EndOfQuarter(#date(2016,_,1)))}, type table[End of Quarter=date]),
Ad_Check = Table.AddColumn(Source, "IsInYTD", each Date.IsInYearToDate(#date(Date.Year(DateTime.FixedLocalNow()), Date.Month([End of Quarter]), Date.Day([End of Quarter]))))
in
Ad_Check
Hi @CiaraCaryl , you haven't specified expected output. What about this one?
let
Source = Table.FromColumns({List.Transform({3,6,9,12}, each Date.EndOfQuarter(#date(2016,_,1)))}, type table[End of Quarter=date]),
Ad_Check = Table.AddColumn(Source, "IsInYTD", each Date.IsInYearToDate(#date(Date.Year(DateTime.FixedLocalNow()), Date.Month([End of Quarter]), Date.Day([End of Quarter]))))
in
Ad_Check
Hi @CiaraCaryl
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!
Best Regards,
Community Support Team _ C Srikanth.
Hi @CiaraCaryl
Could you please confirm if your issue has been resolved?
If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.
Best Regards,
Community Support Team _ C Srikanth.
Hi @CiaraCaryl , here's a different solution you could look at. I'll attach the images of the output and M code used. Thanks
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.