Power BI Embedded Analytics Client API: "FailedToValidateDataRole" when calling visual.AddDataField() - powerbi

I am attempting to add data to a blank Visual using Power BI Embedded Analytics Client API. The visual is type "card".
I am calling visual.AddDataField("Fields", ...) in my JavaScript code
This produces the following error:
FailedToValidateErrorRole Screen shot
Is Fields the correct first parameter here? This is the name of the field when using PowerBI itself:
Power BI card example screen shot

After looking here:
https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/get-visual-capabilities
I added the following line to my source code:
let capabilties = await this.visual.getCapabilities();
Then I was able to see what the data role was that it was expecting which was actually Values
Once I used this it worked.

Related

Power BI Activity Log UpdateWorkspaceAccess

When calling
Get-PowerBIActivityEvent -StartDateTime ($start) -EndDateTime ($end) -ActivityType UpdateWorkspaceAccess
I expected to get all changes to workspace access across all workspaces, similar to activity type ViewReport gives me all report views. For some reason it seems to return activity for the user I'm currently logged in as. Can't find any detailed docs on how UpdateWorkspaceAccess is supposed to work.
Grateful for any pointers.
Well normally this works for me
Get-PowerBIActivityEvent -StartDateTime 2021-12-21T00:00:00 -EndDateTime 2021-12-21T18:00:00 -ActivityType viewreport | Out-File –FilePath C:\Users\Administrator\Desktop\Process.json
You can also use Power BI Rest API :
GET https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime={startDateTime}&endDateTime={endDateTime}&continuationToken={continuationToken}&$filter={$filter}

Dynamic query (Current date) via web services in Power Bi

In my project we are consuming the company's data via Web Service REST. Today we don't do the query dynamically by passing the start date and end date parameters via string.
enter image description here
My goal is for the end date to update dynamically. I've already created a query that takes the current date but I can't put it in the parameter without generating an error in the query.
enter image description here
This is the error message I get when I put the column value in the parameter:
enter image description here
I'm pretty sure I'm getting the syntax wrong. Anyone who can help me, I really appreciate it. I would like to point out that the date format for the API call to work is DD/MM/YYYY.
Can you try using
PutYourOtherTableNameHere[Hoje_Coluna]{0}
instead of
[Hoje_Coluna]
?
To see if that will work, put this in right before your query, then click on the step and see what it returns.
x = PutYourOtherTableNameHere[Hoje_Coluna]{0},

Power BI Embedded - setSlicerState() with Tuple slicer not working/supported? "filters property is invalid"

I can't seem to find a solid answer anywhere if setSlicerFilter() method in javascript for power bi embedded reports supports filterType 6 (tuple) - one post suggests it does not but nothing official.
setSlicerState() is working fine for other types (basic and relativeDate) but returns an error with Tuple specifically: "filters property is invalid"
Below is the state object that i am passing to the setSlicerState() method (which was originally retrieved from the getSlicerState() method, so i believe it's format is just fine)
Getting from slicer with getSlicerState()
Any ideas?
Currently the out-of-the-box hierarchy and tuple slicers aren't supported with powerbi-client.
Reference:
https://learn.microsoft.com/javascript/api/overview/powerbi/control-report-slicers#limitations

Error when loading data into PBI Desktop

I've created a function from a query that fetches the weather forecast from darksy.net API.
Basically, I pass the latitude and longitude as a single parameter to the query and I get a weather forecat.
The parameter is entered as text in the form of "lat,long". Eg: Lisbon is ‎38.736946,-9.142685
Everything works fine, the data is loaded into Power Query. However, when hitting "Close and Apply" button I get the error:
It seems the URL is adding E2%80%8E before the parameter.
I tried 2 differente APIs (darksy.net and http://api.openweathermap.org) and the problem happens in both.
Why is this? Can anyone help?

why custom dateformats not working in oracle bi web service parameter?

I am using Soap-UI to call Oracle-BI web service runReport to generate a report. Its working fine for reports with no report parameters. But when I am passing Date parameters with dateFormatString defined, the report doesn't show any result. Basically, as per my understanding, the web service can't parse the date correctly. Here's what I tried -
<v2:parameterNameValues>
<v2:listOfParamNameValues>
<!--Other parameters-->
<v2:item>
<v2:dataType>Date</v2:dataType>
<v2:dateFormatString>dd-MM-yyyy</v2:dateFormatString>
<v2:name>val_from_dt_in</v2:name>
<v2:values>
<v2:item>01-01-2013</v2:item>
</v2:values>
</v2:item>
<v2:listOfParamNameValues>
<v2:parameterNameValues>
According to oracle docs, the dateFormatString parameter will take any Java date time format string. I have tried dd-MMM-yyyy and yyyy-MM-dd also. But it doesn't work. Can anyone tell me where I am doing wrong?
try this format please:
dd/mm/yyyy