sql-bi / daxtemplate Goto Github PK
View Code? Open in Web Editor NEWTabular and DAX template engine
License: MIT License
Tabular and DAX template engine
License: MIT License
The exception occurs here on line 226
DaxTemplate/Dax.Template/Tables/TableTemplateBase.cs
Lines 217 to 229 in fbc844b
Message: An object with name 'Date' does not exist in the collection. (Parameter 'name')
Exception type: System.ArgumentException
System.ArgumentException:
at Microsoft.AnalysisServices.Tabular.NamedMetadataObjectCollection`2.get_Item (Microsoft.AnalysisServices.Tabular, Version=19.36.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91)
at Dax.Template.Tables.TableTemplateBase.<RestoreAffectedRelationships>g__GetColumn|27_0 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.TableTemplateBase.RestoreAffectedRelationships (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.TableTemplateBase.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.Dates.BaseDateTemplate`1.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.TableTemplateBase.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine.CreateDateTable (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine+<>c__DisplayClass5_0.<ApplyTemplates>g__ApplyCustomDateTable|3 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine+<>c__DisplayClass5_0.<ApplyTemplates>b__0 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at System.Collections.Generic.List`1.ForEach (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Dax.Template.Engine.ApplyTemplates (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
Query (601, 43) A table of multiple values was supplied where a single value was expected.
Repro steps:
TIME
functionSample PBIX file
Exception occurs when cloned columns are restored
Message: Item 'Month' already exists in the collection.
Exception type: System.ArgumentException
System.ArgumentException:
at Microsoft.AnalysisServices.Tabular.NamedMetadataObjectCollection`2.ValidateCanAdd (Microsoft.AnalysisServices.Tabular, Version=19.36.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91)
at Microsoft.AnalysisServices.Tabular.MetadataObjectCollection`2.Add (Microsoft.AnalysisServices.Tabular, Version=19.36.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91)
at Dax.Template.Tables.TableTemplateBase+<>c__DisplayClass30_0.<AddColumns>b__1 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at System.Collections.Generic.List`1.ForEach (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Dax.Template.Tables.TableTemplateBase.AddColumns (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.TableTemplateBase.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.Dates.BaseDateTemplate`1.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Tables.TableTemplateBase.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine.CreateDateTable (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine+<>c__DisplayClass5_0.<ApplyTemplates>g__ApplyCustomDateTable|3 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine+<>c__DisplayClass5_0.<ApplyTemplates>b__0 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at System.Collections.Generic.List`1.ForEach (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Dax.Template.Engine.ApplyTemplates (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
Revert the workaround for the SWITCH
and remove IF
once the bug is fixed.
Issue created to keep track of this TODO in the source code
DaxTemplate/src/Dax.Template/Tables/Dates/HolidaysTable.cs
Lines 117 to 119 in ac0df8b
DaxTemplate/Dax.Template/Tables/TableTemplateBase.cs
Lines 411 to 412 in 2f9a635
Should we also exclude columns of type CalculatedTableColumn
?
var listColumns = from c in dateTable.Columns where c is not CalculatedColumn && c is not CalculatedTableColumn select c;
Running the query to preview the data raises the following error :
An unexpected exception occurred. An unexpected exception occurred.
Unfortunately, there are no further useful details in either the stack trace or the response received from the SSAS server.
Attached here is the PBIX and DAX query to reproduce the error.
These resources could be useful to implement a template for Persian calendars.
Definition: https://en.m.wikipedia.org/wiki/Iranian_calendars
Example in M: https://github.com/Softwaretrain/M-Functions/blob/main/fn_CreateDateTable
The exception occurs here on line 90
DaxTemplate/Dax.Template/Measures/MeasureTemplateBase.cs
Lines 85 to 91 in fbc844b
Message: Item 'YOY Amount' already exists in the collection.
Exception type: System.ArgumentException
System.ArgumentException:
at Microsoft.AnalysisServices.Tabular.NamedMetadataObjectCollection`2.ValidateCanAdd (Microsoft.AnalysisServices.Tabular, Version=19.36.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91)
at Microsoft.AnalysisServices.Tabular.MetadataObjectCollection`2.Add (Microsoft.AnalysisServices.Tabular, Version=19.36.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91)
at Dax.Template.Measures.MeasureTemplateBase.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Measures.MeasuresTemplate+<>c__DisplayClass24_0.<ApplyTemplate>g__ApplyMeasureTemplate|8 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Measures.MeasuresTemplate.ApplyTemplate (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine+<>c__DisplayClass5_0.<ApplyTemplates>g__ApplyMeasuresTemplate|4 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at Dax.Template.Engine+<>c__DisplayClass5_0.<ApplyTemplates>b__0 (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
at System.Collections.Generic.List`1.ForEach (System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Dax.Template.Engine.ApplyTemplates (Dax.Template, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.