Forum Discussion

kalpanaV's avatar
kalpanaV
Helper IV
9 years ago

predictive analytics

 

Hi

i want to achieve predictive analytics in power bi using r, below are the code.

 

but i am not getting 

 

counts <-table(dataset$May2017,dataset$name)
pred <-predict(dataset$May2017)
pred1 <-data.frame(pred)
final <-cbind(counts,pred1)
barplot(final)

13 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi kalpanaV,

    What's your issue? Did you get an error message? If you want to create a R visual in Power BI desktop, you should follow the following steps.

    1. Install R in your local computer.

    2. Enabling visuals by selecting File-> Options and settings-> Options ->R Scripting, type the R installation path.

    3. Type your resource data in a table, create a visual, add the 'May2017' and 'name' fields to values level. Then it will create the dataset(highlighted in yellow backgroud) automatically. Finally type your R script in the write zone highlighted in blue line.



    Best Regards,
    Angelia

    • kalpanaV's avatar
      kalpanaV
      Helper IV

      i did that. i want to achieve predictive analytics.i can do normal bar chart , line chart

      • v-huizhn-msft's avatar
        v-huizhn-msft
        Microsoft Employee

        Hi kalpanaV,

        You did it in R visual, if it worked fine? If it works fine in R visual, it should have no problem of creating R visual.

        Best Regards,
        Angelia