Example #1
0
        private static void Sample_DataTable(PBIAPIClient pbic)
        {
            PBIDataset dataset = new PBIDataset("MyPushDataset", PBIDefaultMode.Push);

            dataset.ParentPowerBIAPI = pbic;
            dataset.SyncFromPowerBI(); // check if a Dataset with the same ID or Name already exists in the PowerBI-Service

            // create a regular DataTable - but could also be derived from a SQL Database!
            DataTable dataTable = new DataTable();
            /* populate the dataTable */
            // create a PBI table from a regular DataTable object
            PBITable productsTable = new PBITable(dataTable);

            // publish the table and push the rows from the dataTable to the PowerBI table
            productsTable.PublishToPowerBI(true);
        }
Example #2
0
        private static void Sample_DataTable()
        {
            // AppID: the ID of the Azure AD Application
            string ApplicationID = ConfigurationManager.AppSettings["PBI_ApplicationID"];

            PBIAPIClient powerBIClient = new PBIAPIClient(ApplicationID);

            PBIDataset dataset = new PBIDataset("MyPushDataset");

            dataset.PBIDefaultMode   = PBIDefaultMode.Push;
            dataset.ParentPowerBIAPI = powerBIClient;
            dataset.SyncFromPowerBI(); // check if a Dataset with the same ID or Name already exists in the PowerBI-Service

            // create a regular DataTable - but could also be derived from a SQL Database!
            DataTable dataTable = new DataTable();
            /* populate the dataTable */
            // create a PBI table from a regular DataTable object
            PBITable productsTable = new PBITable(dataTable);

            // publish the table and push the rows from the dataTable to the PowerBI table
            productsTable.PublishToPowerBI(true);
        }