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

Community site session details

Session Id :
Power Automate - Building Flows
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 101

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

I have the same question (0)
  • royg Profile Picture
    on at
    Re: 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

    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
    101 on at
    Re: 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

    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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 535 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 348 Moderator

#3
developerAJ Profile Picture

developerAJ 262

Last 30 days Overall leaderboard