### Example Power BI Template App Installation URL Source: https://learn.microsoft.com/en-us/power-bi/connect-data/template-apps-auto-install-tutorial This is an example of an installation URL for a Power BI template app. It contains parameters like appId, packageKey, and ownerId that are needed for automated installation. ```html https://app.powerbi.com/Redirect?action=InstallApp&appId=66667...9cccc0000&packageKey=b2df4b...dLpHIUnum2pr6k&ownerId=aaaa...22222&buildVersion=5 ``` -------------------------------- ### Run the embed sample app Source: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization Execute this command to start the sample application after installing dependencies. You may be prompted to grant Microsoft Entra permissions on first sign-in. ```bash npm run start ``` -------------------------------- ### Create Install Ticket for Template App Source: https://learn.microsoft.com/en-us/power-bi/connect-data/template-apps-auto-install This example demonstrates how to create an install ticket for a Power BI template app using the .NET SDK. This ticket is used when redirecting users to Power BI for installation and configuration. ```csharp using Microsoft.PowerBI.Api.V2; using Microsoft.PowerBI.Api.V2.Models; // Create Install Ticket Request. InstallTicket ticketResponse = null; var request = new CreateInstallTicketRequest() { InstallDetails = new List() { new TemplateAppInstallDetails() { AppId = Guid.Parse(AppId), PackageKey = PackageKey, OwnerTenantId = Guid.Parse(OwnerId), Config = new TemplateAppConfigurationRequest() { Configuration = Parameters .GroupBy(p => p.Name) .ToDictionary(k => k.Key, k => k.Select(p => p.Value).Single()) } } } }; // Issue the request to the REST API using .NET SDK. InstallTicket ticketResponse = await client.TemplateApps.CreateInstallTicketAsync(request); ``` -------------------------------- ### Installation Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/utils-tooltip Install the powerbi-visuals-utils-tooltiputils package using npm. ```bash npm install powerbi-visuals-utils-tooltiputils --save ``` -------------------------------- ### Install powerbi-authoring plugin with GitHub Copilot CLI Source: https://learn.microsoft.com/en-us/power-bi/developer/agentic/power-bi-agentic-overview Installs the powerbi-authoring plugin from the skills-for-fabric marketplace using the GitHub Copilot CLI. Ensure Node.js 18 or later is installed. ```bash copilot plugin marketplace add microsoft/skills-for-fabric copilot plugin install powerbi-authoring@fabric-collection ``` -------------------------------- ### Install powerbi-visuals-utils-typeutils Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/utils-type Install the package using npm. This command adds the package as a dependency to your package.json file. ```bash npm install powerbi-visuals-utils-typeutils --save ``` -------------------------------- ### Clone and Build Sample Project Source: https://learn.microsoft.com/en-us/power-bi/developer/execute-dax-queries-arrow/dotnet-mid-tier-service Clone the sample repository and verify that the solution compiles successfully. This step ensures the project setup is correct before making modifications. ```bash git clone https://github.com/dbrownems/Microsoft.Samples.XMLA.ExecuteQueries.git cd Microsoft.Samples.XMLA.ExecuteQueries dotnet build ``` -------------------------------- ### Install D3 JavaScript Library Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/create-bar-chart If the D3 JavaScript library wasn't installed as part of your setup, install it now using npm. ```powershell npm i d3@latest --save ``` -------------------------------- ### Install dependencies for embed sample app Source: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-your-organization Run this command in the terminal to install the necessary packages for the sample application. ```bash npm install ``` -------------------------------- ### Get Touch Start Event Name Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/utils-tooltip Returns the appropriate string for a touch start event, useful for cross-platform compatibility. ```TypeScript function touchStartEventName(): string ``` -------------------------------- ### Web Connection Example Source: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-sources Connect to a web resource. Replace 'URL-here' with the web URL. ```json { "version": "0.1", "connections": [ { "details": { "protocol": "http", "address": { "url": "URL-here" } } } ] } ``` -------------------------------- ### Example Usage of createLocalizationManager Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/utils-test Demonstrates how to import and use the createLocalizationManager function to get a mock ILocalizationManager instance for testing purposes. ```typescript import { createLocalizationManager } from "powerbi-visuals-utils-testutils"; let localizationManagerMock: ILocalizationManager = createLocalizationManager(); ``` -------------------------------- ### Example Usage of createColorPalette Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/utils-test Shows how to import and use the createColorPalette utility to get a mock IColorPalette instance for testing visual color properties. ```typescript import { createColorPalette } from "powerbi-visuals-utils-testutils" let colorPalette: IColorPalette = createColorPalette(); ``` -------------------------------- ### Install .NET Dependencies Source: https://learn.microsoft.com/en-us/power-bi/developer/execute-dax-queries-arrow/get-started Install the required .NET packages for authentication and Arrow data handling. A .NET 8 SDK or later is necessary. ```bash dotnet add package Microsoft.Identity.Client dotnet add package Apache.Arrow ``` -------------------------------- ### Text File Connection Example Source: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-sources Connect to a text file. Replace 'path-here' with the file path. ```json { "version": "0.1", "connections": [ { "details": { "protocol": "file", "address": { "path": "path-here" } } } ] } ``` -------------------------------- ### Get All Power BI Workspaces Source: https://learn.microsoft.com/en-us/power-bi/enterprise/service-encryption-byok Use this PowerShell command to identify items stored in your workspaces. Ensure you have the Power BI management module installed. ```powershell PS C:\> Get-PowerBIWorkspace -Scope Organization -Include All ``` -------------------------------- ### Folder Connection Example Source: https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-sources Connect to a local or network folder. Replace 'folder-path-here' with the actual folder path. ```json { "version": "0.1", "connections": [ { "details": { "protocol": "folder", "address": { "path": "folder-path-here" } } } ] } ``` -------------------------------- ### Using ColorHelper for High Contrast Colors Source: https://learn.microsoft.com/en-us/power-bi/developer/visuals/utils-color Example demonstrating the initialization of ColorHelper and its use to get high-contrast colors for visual elements like font color and background color. ```TypeScript import { ColorHelper } from "powerbi-visuals-utils-colorutils"; export class MyVisual implements IVisual { private colorHelper: ColorHelper; private init(options: VisualConstructorOptions): void { this.colors = options.host.colorPalette; this.colorHelper = new ColorHelper(this.colors); } private createViewport(element: HTMLElement): void { const fontColor: string = "#131aea"; const axisBackgroundColor: string = this.colorHelper.getThemeColor(); // some d3 code before d3ElementName.attr("fill", colorHelper.getHighContrastColor("foreground", fontColor); } public static parseSettings(dataView: DataView, colorHelper: ColorHelper): VisualSettings { // some code that should be applied on formatting settings if (colorHelper.isHighContrast) { this.settings.fontColor = colorHelper.getHighContrastColor("foreground", this.settings.fontColor); } } } ``` -------------------------------- ### Example of Creating Certificate in HANA Source: https://learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-sso-saml An example demonstrating how to create a certificate in SAP HANA using a placeholder for the certificate content. ```sql CREATE CERTIFICATE FROM '-----BEGIN CERTIFICATE----- MIIDyDCCArCgA...veryLongString...0WkC5deeawTyMje6 -----END CERTIFICATE-----' ``` -------------------------------- ### Insert Sample Project Data in SQL Source: https://learn.microsoft.com/en-us/power-bi/create-reports/translytical-task-flow-tutorial-status-update Inserts sample data into the 'Project' table. This script provides example records for various projects with details like name, dates, budget, and status. ```sql INSERT INTO [Project] ([Project id], [Project name], [Product name], [Description], [Priority], [Start date], [Target end date], [Budget], [Project manager], [Department], [Created date], [Created by], [Is active]) VALUES (1, 'Best Practices with Power BI - FabCon Atlanta', 'FabCon Atlanta', 'Session covering Power BI best practices for enterprise deployments', 'High', '2026-01-15', '2026-03-20', 5000.00, 'person1@somecompany.com', 'Developer Relations', '2026-01-15', 'Admin', 1), (2, 'Translytical Task Flows - Build', 'Microsoft Build', 'Deep dive into translytical workloads and real-time analytics patterns', 'Critical', '2026-02-01', '2026-05-19', 7500.00, 'person2@somecompany.com', 'Product Engineering', '2026-02-01', 'Admin', 1), (3, 'Advanced DAX Patterns - FabCon Barcelona', 'FabCon Barcelona', 'Workshop on complex DAX calculations and optimization techniques', 'High', '2026-03-01', '2026-09-15', 6000.00, 'person1@somecompany.com', 'Developer Relations', '2026-02-20', 'Admin', 1), (4, 'Semantic Modeling Deep Dive - Ignite', 'Microsoft Ignite', 'Comprehensive session on semantic model design and best practices', 'High', '2026-01-10', '2026-11-18', 8000.00, 'person2@somecompany.com', 'Product Engineering', '2026-01-10', 'Admin', 1), (5, 'Custom Visuals in Power BI - FabCon Atlanta', 'FabCon Atlanta', 'Hands-on lab for building custom visuals with the Power BI SDK', 'Medium', '2025-12-01', '2026-03-20', 4500.00, 'person1@somecompany.com', 'Developer Relations', '2025-12-01', 'Admin', 1), (6, 'TMDL for Version Control - Build', 'Microsoft Build', 'Session on using TMDL for semantic model source control and CI/CD', 'Critical', '2025-11-15', '2026-02-15', 5500.00, 'person2@somecompany.com', 'Product Engineering', '2025-11-15', 'Admin', 1), (7, 'Real-time Analytics with Power BI - Ignite', 'Microsoft Ignite', 'Showcase of Direct Lake and real-time streaming capabilities', 'High', '2026-02-10', '2026-11-18', 7000.00, 'person1@somecompany.com', 'Developer Relations', '2026-02-10', 'Admin', 1), (8, 'Semantic Modeling Workshop - FabCon Barcelona', 'FabCon Barcelona', 'Interactive workshop on building enterprise-grade semantic models', 'High', '2026-04-01', '2026-09-15', 6500.00, 'person2@somecompany.com', 'Product Engineering', '2026-02-25', 'Admin', 1); ``` -------------------------------- ### List Refresh Operations Source: https://learn.microsoft.com/en-us/power-bi/connect-data/asynchronous-refresh Use the GET verb on the /refreshes collection to list historical, current, and pending refresh operations. The response includes details like request ID, refresh type, start and end times, and status. ```json [ { "requestId": "ddddeeee-3333-ffff-4444-aaaa5555bbbb", "refreshType": "ViaEnhancedApi", "startTime": "2020-12-07T02:06:57.1838734Z", "endTime": "2020-12-07T02:07:00.4929675Z", "status": "Completed", "extendedStatus": "Completed" }, { "requestId": "474fc5a0-3d69-4c5d-adb4-8a846fa5580b", "startTime": "2020-12-07T01:05:54.157324Z", "refreshType": "ViaEnhancedApi", "status": "Unknown" } { "requestId": "85a82498-2209-428c-b273-f87b3a1eb905", "refreshType": "ViaEnhancedApi", "startTime": "2020-12-07T01:05:54.157324Z", "status": "Unknown", "extendedStatus": "NotStarted" } ] ```