cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JSheldrake Frequent Visitor
Frequent Visitor

DATESYTD -YearEndDate pulled from SQL Server

Hi All,

 

the Syntax for DATESYTD is as follows : 

 

DATESYTD(Dates,YearEndDate)

 

I have a calculation that includes the DATESYTD() function in which i want to pull the YearEndDate input from my SQL Server.

 

The YearEndDate is currently stored in a config table and i was trying to pull it through using the following Measure

 

FiscalStartMonth = LOOKUPVALUE(_Config[Value],_Config[Name],"FiscalStartMonth")

 

This produces the right result but when used within the DATESYTD function I get the following error:

 

Calculation : DatesYTD([Date],[FiscalStartMonth])

 

Error:  Only constant date value is allowed as a year end date argument

 

If I can find a solution to this I can simply update the config file and this will then update all the measures and remove the manual work.

 

Thanks In Advance

Jason Sheldrake

 

2 REPLIES 2
Super User IV
Super User IV

Re: DATESYTD -YearEndDate pulled from SQL Server

Any chance you could use your FirstStartMonth as a VAR in your measure and have that work? Probably not if it truly wants a constant.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

JSheldrake Frequent Visitor
Frequent Visitor

Re: DATESYTD -YearEndDate pulled from SQL Server

Nope didnt work but thanks anway.

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors