DaxStudio / DaxStudio

DAX Studio is a tool to write, execute, and analyze DAX queries in Power BI Desktop, Power Pivot for Excel, and Analysis Services Tabular.
http://daxstudio.org
Other
696 stars 144 forks source link

Dax Studio does not connect to the xmla endpoint when there is a duplicate dataset #1328

Open gpaulocorrea opened 2 days ago

gpaulocorrea commented 2 days ago

Dax Studio does not connect to the xmla endpoint when there is a duplicate dataset. This happens because Power BI allows you to publish a report with a space at the end of the name. Within Dax Studio, a method identifies the dataset without a space at the end of the name, and the dataset with a space at the end of the name as being duplicated and an error is displayed. This prevents the databases from being listed in Dax Studio.

How to reproduce: Publish a report to Power BI Publish the report by adding a space at the end of the name (before .pbix) Try to connect to the workspace using the xmla endpoint An error will be displayed informing you that the key is duplicated and will not list the datasets in the workspace.

For debug: The error occurs in the ADOTabularDatabaseConnection file, in the GetDatabaseTable() method

            _dsDatabases.Tables[0].PrimaryKey = new[] {
                _dsDatabases.Tables[0].Columns["CATALOG_NAME"]
            };
dgosbell commented 1 day ago

What is the value in having 2 identically named datasets in the one workspace? I have not checked yet, but I'd guess that the MDSCHEMA_CATALOGS DMV that I use to the list of database names trims trailing spaces. Wouldn't the simplest fix for this be to change the name of one of the datasets?