Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
12 | |
8 | |
8 |
User | Count |
---|---|
17 | |
10 | |
7 | |
7 | |
7 |