Forum Discussion

Canale's avatar
Canale
Regular Visitor
8 years ago
Solved

R TO POWERBI STREAMING

Hello

 

How can push data from R to powerbi online.

 

Do you have any idea about this.

 

any example.

 

Thank you

 

 

  • Hi Canale,

     

    Please refer to a simple example below.

    1. Create a streaming dataset in Power BI Service. (No authentication is needed when creating a streaming dataset this way. Reference: service-real-time-streaming#using-the-streaming-dataset-ui-to-push-data).

    2. Get the Push URL from the dataset.

    3. Create Dashboard and add a tile based on this dataset in order to see the effects.

    4. Try the code below.

    library(httr)
    
    dataset_url <- "https://api.powerbi.com/beta/ThisIsPushURL"
    for (id_value in c(10: 100)) {
        new_data <- paste('[{"ID": ', id_value, ', "Value": "A"}]')
        POST(dataset_url, body = new_data)
    }

    R_TO_POWERBI_STREAMING

     

    Best Regards,

    Dale

2 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Canale,

     

    Please refer to a simple example below.

    1. Create a streaming dataset in Power BI Service. (No authentication is needed when creating a streaming dataset this way. Reference: service-real-time-streaming#using-the-streaming-dataset-ui-to-push-data).

    2. Get the Push URL from the dataset.

    3. Create Dashboard and add a tile based on this dataset in order to see the effects.

    4. Try the code below.

    library(httr)
    
    dataset_url <- "https://api.powerbi.com/beta/ThisIsPushURL"
    for (id_value in c(10: 100)) {
        new_data <- paste('[{"ID": ', id_value, ', "Value": "A"}]')
        POST(dataset_url, body = new_data)
    }

    R_TO_POWERBI_STREAMING

     

    Best Regards,

    Dale