web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I am trying to get dat...
Power Automate
Unanswered

I am trying to get data from run a query against a dataset PBI and add or update a row in sharepoint list based on code

(0) ShareShare
ReportReport
Posted on by 102

I have created the query for the powerbi Run a query against a dataset

// DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZE('crm', 'crm'[carrier_code], 'crm'[max_date], 'crm'[region])

VAR __DS0PrimaryWindowed =
TOPN(501, __DS0Core, 'crm'[carrier_code], 1, 'crm'[max_date], 1, 'crm'[region], 1)

EVALUATE
__DS0PrimaryWindowed

ORDER BY
'crm'[carrier_code], 'crm'[max_date], 'crm'[region]

 

but after this I have not been able to get this data added or appended to a sharepoint list. 

The data is carrier code , region and max_date , the aim is to add a row to sharepoint list if code does not exist , or apend a row if code exist , if appending row I just need the max_date changing. I have created the sharepoint list with matching column names. But have not been able to find a way to get this task completed. Any help would be much appreciated thanks

Categories:
I have the same question (0)
  • royg Profile Picture
    on at

    Hi @JD_26,

    Are you able to get the data using the "Run a query against a dataset" action? The result is usually in the 1st table so simplify by adding a Select action to trim the data:

    royg_0-1719311585204.png

    then process the outputs of your select action per your requirement (adding/updating existing records)

  • JD_26 Profile Picture
    102 on at

    Thanks , I can replicate what you have shown , but the I am struggling on the next steps for the apply to each , it just does not progress any further , if I hover over wheel icon it says Not Specified , I am using the Output body from select for Apply to each , then I am using body/value from Get items in the for each , an I am using if Title which is from Sharepoint list equals @{items('Apply_to_each')?['crm[carrier_code]']} , then true , then I use update item and I use 

     

    • Title: @{items('Apply_to_each')?['crm[carrier_code]']}.
    • region: @{items('Apply_to_each')?['crm[region]']}.
    • max_date: @{if(equals(items('Apply_to_each')?['crm[max_date]'], null), '', items('Apply_to_each')?['crm[max_date]'])}.
    • flow is like this 

     

    JD_26_0-1719313500262.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard