Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Has anyone been able to use the Rblpapi package in Power BI? I have a Dates table and use a slicer to narrow it to a range. I'm trying to use that range to get a list of historical prices for a security I pass in.
Example:
library(Rblpapi)
bdh(securities = 'GOOG US Equity',
fields = "PX_LAST",
start.date = as.Date(DATE),
include.non.trading.days = FALSE)
This gives me:
Error in as.Date(DATE) : object 'DATE' not found
Calls: bdh -> as.Date
Execution halted
Any thoughts?
Solved! Go to Solution.
Hey,
I'm not that familiar with the package Rblpapi package, but I assume that you have to utilize the dataframe that contains the columns from the values bucket, that is passed from Power BI to the R script.
For this reason I would expect that this line
as.Date(DATE)
should look like this
as.Date(dataset$nameofyourdatecolumn)
Please be aware that R is case sensitive 🙂
A short investigation of the bdh function also expects a connection parameter, I guess you have to provide this connection inside your script.
I hope this helps somehow
Hey,
I'm not that familiar with the package Rblpapi package, but I assume that you have to utilize the dataframe that contains the columns from the values bucket, that is passed from Power BI to the R script.
For this reason I would expect that this line
as.Date(DATE)
should look like this
as.Date(dataset$nameofyourdatecolumn)
Please be aware that R is case sensitive 🙂
A short investigation of the bdh function also expects a connection parameter, I guess you have to provide this connection inside your script.
I hope this helps somehow
It was the dataframe, much apprec!
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |