Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
cpooja
Regular Visitor

Create a button in Power BI

I have created one view name as C_Dashboard view which is running daily for all the customers (ex - having one column customer and the values like CustA,CustB) in azure synapse pipeline. Also i have created customer specific views - CustA_Dashboard view(only shows CustA data) and CustB_Dashboard view(only shows CustB data) in azure synapse pipeline. I have created power bi report - SLA Dashboard using C_Dashboard view and applied Role level security so that CustA user will see CustA data and CustB user will see CustB data when they access SLA dashoard. i have published the SLA dashboard in workspace 1. Also i have created reports - SLA dashboard_CustA (using CustA_Dashboard view) and SLA dashboard_CustB(using CustB_Dashboard view) and published the reports in workspace 2. Now i want to create button in SLA Dashboard(published in workspace 1) so that when CustA user will login to SLA Dashboard then the report will show only CustA data as we have applied role level security. and when the CustA user will click on the button then CustA view should refresh in azure synapse pipeline and SLA dashboard_CustA dataset in workspace 2. and when the CustB user will click on the button then CustB view should refresh in azure synapse pipeline and SLA dashboard_CustB dataset in workspace 2.How to do create a button in SLA Dashboard.

1 ACCEPTED SOLUTION
elitesmitpatel
Solution Supplier
Solution Supplier

Power BI buttons can't directly trigger data refreshes in Azure Synapse Pipelines. However, you can achieve a similar experience using a combination of Power Automate and buttons. Here's how:

1. Create a Power Automate Flow:

Go to Power Automate (https://flow.microsoft.com/).
Create a new flow.
Choose "Automated cloud flow" as the trigger.
Search for "Power BI" and select the trigger "When a button is pressed in a report".
Connect to your Power BI service account.
In the "Report" field, select "SLA Dashboard".
In the "Button name" field, choose a descriptive name for your button (e.g., "Refresh Customer Data").


2. Use Conditional Logic based on User Role:

- Add a "Condition" step.
- Use an expression like `userPrincipalName()` to get the logged-in user's email address.
- Check if the email address belongs to CustA or CustB using an "equals" condition.


3. Refresh Data based on User Role:

- Add two separate "Azure Synapse Analytics" actions (one for CustA and one for CustB).
- Connect to your Azure Synapse Analytics workspace.
- In the "Trigger Now" field, set it to "Yes".
- Use conditional logic from step 2 to determine which action to execute.
- If the user is CustA, call the Azure Synapse action that refreshes the "CustA_Dashboard" view.
- If the user is CustB, call the Azure Synapse action that refreshes the "CustB_Dashboard" view.


4. (Optional) Refresh Power BI Dataset (Workspace 2):

- You can add additional steps to refresh the relevant Power BI dataset in workspace 2. However, this refresh might not be instantaneous and might take some time to reflect in the report.


5. Create the Button in Power BI:

- Go back to Power BI Desktop.
- In the "Insert" tab, select "Power Automate".
- Choose the flow you created in step 1.
- Format the button and place it in your report.

If it Helps Kudos to work and Accept it as Solution.

View solution in original post

2 REPLIES 2
elitesmitpatel
Solution Supplier
Solution Supplier

Power BI buttons can't directly trigger data refreshes in Azure Synapse Pipelines. However, you can achieve a similar experience using a combination of Power Automate and buttons. Here's how:

1. Create a Power Automate Flow:

Go to Power Automate (https://flow.microsoft.com/).
Create a new flow.
Choose "Automated cloud flow" as the trigger.
Search for "Power BI" and select the trigger "When a button is pressed in a report".
Connect to your Power BI service account.
In the "Report" field, select "SLA Dashboard".
In the "Button name" field, choose a descriptive name for your button (e.g., "Refresh Customer Data").


2. Use Conditional Logic based on User Role:

- Add a "Condition" step.
- Use an expression like `userPrincipalName()` to get the logged-in user's email address.
- Check if the email address belongs to CustA or CustB using an "equals" condition.


3. Refresh Data based on User Role:

- Add two separate "Azure Synapse Analytics" actions (one for CustA and one for CustB).
- Connect to your Azure Synapse Analytics workspace.
- In the "Trigger Now" field, set it to "Yes".
- Use conditional logic from step 2 to determine which action to execute.
- If the user is CustA, call the Azure Synapse action that refreshes the "CustA_Dashboard" view.
- If the user is CustB, call the Azure Synapse action that refreshes the "CustB_Dashboard" view.


4. (Optional) Refresh Power BI Dataset (Workspace 2):

- You can add additional steps to refresh the relevant Power BI dataset in workspace 2. However, this refresh might not be instantaneous and might take some time to reflect in the report.


5. Create the Button in Power BI:

- Go back to Power BI Desktop.
- In the "Insert" tab, select "Power Automate".
- Choose the flow you created in step 1.
- Format the button and place it in your report.

If it Helps Kudos to work and Accept it as Solution.

grazitti_sapna
Super User
Super User

Hi @cpooja ,To achieve the functionality you described, you can create a button in the SLA Dashboard (published in Workspace 1) that triggers a refresh in Azure Synapse and updates the corresponding dataset in Power BI Workspace 2. Here's a step-by-step guide:
Step 1: Create a Custom Button in Power BI

  1. Add a Button to the SLA Dashboard:
    • Open the SLA Dashboard in Power BI Desktop.
    • Go to the Insert tab and choose Button > Blank Button or select a pre-designed button type.
    • Customize the button's appearance (e.g., text like "Refresh CustA Data" or "Refresh CustB Data") in the Format Button pane.
  2. Add an Action to the Button:
    • In the Button properties, enable the Action setting.
    • For the Action Type, select Web URL. You’ll use this to call the Azure Synapse Pipeline and trigger the refresh.

 

Step 2: Set Up Azure Synapse Pipeline Trigger

  1. Create an API Endpoint for Synapse Pipeline:
    • Go to the Azure Synapse Studio.
    • Navigate to the pipeline for each customer-specific view (CustA_Dashboard or CustB_Dashboard).
    • Publish your pipelines and configure triggers for each one using REST API endpoints:
  2. Grant Required Permissions:
    • Ensure that the Power BI service account or users triggering this pipeline have appropriate Azure Active Directory (AAD) permissions to execute the REST API call for the pipeline.

 

Step 3: Automate Dataset Refresh in Power BI

  1. Configure Power BI Dataset Refresh via API:
  2. Create an Azure Logic App or Power Automate Flow:
    • Create a Logic App or Flow that:
      • Triggers the Synapse Pipeline: Use the Synapse REST API URL for the respective pipeline.
      • Refreshes the Dataset: Use the Power BI REST API to trigger the refresh of the specific dataset (SLA Dashboard_CustA or SLA Dashboard_CustB).
    • Set this up so the Logic App or Flow URL can be triggered via a single HTTP call.

 

Step 4: Connect Button to Logic App or Flow

  1. Retrieve the HTTP Trigger URL:
    • Once the Logic App or Power Automate Flow is published, you’ll get an HTTP trigger URL. This URL will invoke the pipeline refresh and dataset refresh for the specified customer.
  2. Link the Button to the URL:
    • Go back to Power BI Desktop.
    • In the Web URL field of the button action, paste the HTTP trigger URL from the Logic App or Flow.
    • Customize the URL for each customer-specific button (e.g., one for CustA and one for CustB).

 

Step 5: Test the Button

  1. Publish the updated SLA Dashboard with the button to Power BI Workspace 1.
  2. Test the button by clicking it in the Power BI Service:
    • The button should trigger the Azure Synapse Pipeline refresh for the specific customer.
    • It should then trigger the dataset refresh in Workspace 2 for the corresponding SLA Dashboard_CustX.

I hope the provided solution works for you

If I have resolved your question, please consider marking my post as a solution. Thank you!
A kudos is always appreciated—it helps acknowledge the effort and keeps the community thriving.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.