sql-bi / DaxTemplate

Tabular and DAX template engine
MIT License
17 stars 4 forks source link

Bravo\ManageDates - multiple values supplied, single value expected #30

Open albertospelta opened 1 year ago

albertospelta commented 1 year ago

Query (601, 43) A table of multiple values was supplied where a single value was expected.

Repro steps:

image

Sample PBIX file

DaxTemplateIssue.zip

marcosqlbi commented 1 year ago

The issue is that the column with TIME generates a date in 1900 and the table generated for the holidays is correct, but LOOKUPVALUE generates an error comparing dates that are before 1908. Thus, it seems we have to move the generation of holidays from 1908 even when dates in the model are earlier than that. We should also ignore columns marked as TIME in the attributes for Power BI. I will fix the DaxTemplate library as this might require changes in the code and not only in the template files. The current workaround in this case is to specify First Year and Last Year in the parameters.