Author: James Mounsey-Moran

  • How to Connect Power BI to Power Automate: Running DAX Queries

    How to Connect Power BI to Power Automate: Running DAX Queries

    In a world of AI, Fabric Apps and all fancy things popping up at the moment, I have a need to go a little more back to basics. So in the first part of a bit of a series of what I’m building at the moment, this is how to connect Power BI to Power Automate: Running DAX Queries.


    Power Automate gives us simple ways to connect into a semantic model and pull data, but how do you pull the data you actually need?


    Let’s start with connecting everything up and getting all the pre-reqs in place!

    Power BI Workspace

    First of all make sure you have a Power BI report (open still in PBI Desktop), uploaded into a workspace with a connected semantic model. You will also need to ensure the account you are going into Power Automate with has permissions into the workspace.

    • Power BI report uploaded to workspace
    • Connected semantic model
    • User account has permissions on the workspace
    • Have the Power BI report open in PBI Desktop

    PowerAutomate

    Now into Power Automate at:

    https://make.powerautomate.com

    • Into My Flows / New Flow
    • Then depending on choice the type (I have chosen Scheduled Cloud Flow)
    • Give your flow a name and if following my Scheduled Cloud Flow add in a Schedule
    • Select the Plus under Recurrence, which opens the Add an Action tab And search for “Power BI”

    Which should give you these options:

    The option we need here is:

    It will possibly ask you to sign in with an account (make sure to use one that has access to the Power BI workspace from earlier).

    This should now give you this!

    Next is as simple as choosing the Workspace and Dataset we want to use by using the various dropdowns. The main area we want to focus on is the Query Text.

    Back into PowerBI Desktop

    Best way now is to jump back into Power BI Desktop (make sure you have the same report open as what is uploaded to the workspace).

    • Open Optimize and then Performance Analyzer
    • Start Recording
    • Refresh Visuals
    • Select the visual we are wanting to export and you should see a Copy Query button / Run in DAX Query View

    Select “Run in DAX Query View” and you will be able to see the raw DAX and the output it produces. For example, in my test data I get the below:

    Now remember that Query Text field back in Power Automate? Copy the query from Power BI straight into that box!

    And there we go, we now have Power Automate running DAX queries against your model, ready to be used in a number of ways!

    A Bit Extra

    Let’s just add some extra actions so we can extract that data and test through an email!

    • Add a “Data Operations” action and then select Dynamic Content to add the data coming from Power BI.
    • Add a “Send an Email V2” action, and fill in some relevant details such as To, Subject. Select Body and again choose Dynamic Content, but this time the output from the Data Operation.

    Great! So let’s now save and test!

    Into Outlook, and here it is body of an email!

    Looks a little basic, but that’s a problem for another time!

    Thanks for reading through! Any questions, feel free to reach out!

    But this is going to form the basis for a number of things we can do, whether that’s Power Automate, Copilot Studio, AI actions

    Lots!

  • Microsoft MVP 2026 – James Mounsey-Moran

    Microsoft MVP 2026 – James Mounsey-Moran

    Oh wow this is an amazing one! I’ve been awarded the Microsoft MVP 2026 for Data Platform! Power BI specifically!


    Genuinely can’t believe it! It has been so great giving back to the community in many many ways that originally helped me build Prism. Something that has shaped my life and career massively!

    So many people I can thank here, it’s amazing how many people have supported me along the way.

    First of all, of course a massive thanks to Kristine Kolodziejski 🏎️for helping me build up, guiding me through everything and ultimately nominating me! Thankyou so so much, it means so much to me it really does!

    Secondly, of course thankyou to my family, who have been dealing with me talking about and writing blogs at random points in the week, attending conferences up and down the country and hearing about Prism and PowerBI for the 100th time that day!

    Thankyou for the amazing support I’ve had from Charlotte Henigan Simon Williams Wesley Worland and all of Trustmarque who have pushed me, guided me forward and let me create and build with such an incredible group of colleagues, customers and community all the same.

    So many faces, past and new have been there to push me forward, give feedback, offer kind words and just motivate me in every way possible!

    This list could be ten times longer without a doubt but here goes with more thanks! Chris Phillips Damien Masterson Kathryn Reeves Emma Hurrell David Warner II Jordan Berger Sean Hannah Chloe Picton Russell Payne

    Thankyou so much for everything, you are all just amazing!

  • Search for PowerBI parameters with PowerShell

    Search for PowerBI parameters with PowerShell

    Thanks for bearing with me! First blog post of 2026, lets just say I have been busy! To start us off, I have another PowerShell script I put together the end of last year, a way to search for PowerBI parameters with PowerShell.

    When running:

    • multiple workspaces
    • with multiple reports
    • all with multiple parameters

    Sometimes, it seems you need an easy solution to find where you have set parameters to specific items.

    My use case for example, I have a number of reports pointing to a specific data source. When migrating that data source I wanted to discover which reports where still attached so this script made it super simple!

    This PowerShell script, similar to a few of my others will loop through all the PowerBI workspaces you have access to, and at the same time loop through every report and parameter, logging where it finds the defined parameter as it goes.

    The parameters endpoint for every dataset makes it simple to find this information and we can simply loop through each. It will naturally log results in a custom object showing the:

    • Workspace Name
    • Report Name
    • Parameter Name
    • Current Parameter Value
    • Dataset ID

    This is one is a real simple one, just change the searchValue to the actual value of the parameter itself you want to discover, for example

    Parameter Name : Source

    Parameter Value : SQLDB1

    So in this case we search for SQLDB1

    So hopefully this will help you! It certainly saved a huge amount of time for me! code below!

    Connect-PowerBIServiceAccount
    
    # The value you are searching for
    $SearchValue = "Domain"
    
    $workspaces = Get-PowerBIWorkspace -All
    
    Write-Host "Starting Scan" -ForegroundColor Yellow
    
    
    $Results = $workspaces | ForEach-Object -Parallel {
        $Target = $using:SearchValue
        $workspace = $_
        
        try {
            # Get reports in this workspace
            $Reportlist = Get-PowerBIReport -WorkspaceId $workspace.Id
            
            foreach ($Report in $Reportlist) {
                if (-not $Report.DatasetId) { continue }
    
                # Fetch parameters for the dataset
                $Url = "https://api.powerbi.com/v1.0/myorg/groups/$($workspace.Id)/datasets/$($Report.DatasetId)/parameters"
                $resp = Invoke-PowerBIRestMethod -Url $Url -Method Get
                $params = (ConvertFrom-Json $resp).value
    
                foreach ($p in $params) {
                    if ($p.currentValue -eq $Target) {
                        
                        Write-Host "[MATCH] Workspace: $($workspace.Name)" -ForegroundColor Cyan
                        Write-Host "        Report:    $($Report.Name)" -ForegroundColor White
                        Write-Host "        Parameter: $($p.name)" -ForegroundColor Green
    
    
                        # Collect in Object
                        [PSCustomObject]@{
                            Workspace     = $workspace.Name
                            Report        = $Report.Name
                            ParameterName = $p.name
                            ParameterValue = $p.currentValue
                            DatasetId     = $Report.DatasetId
                        }
                    }
                }
            }
        } catch {
            # Skip datasets that cannot be accessed
        }
    } -ThrottleLimit 8
    
    if ($Results) {
        $Results | Out-GridView -Title "Search Results: Parameter Value '$SearchValue'"
    } else {
        Write-Host "No reports found with parameter value: $SearchValue" -ForegroundColor Red
    }