March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
How to connect power bi to microsoft teams, extracting information from app shifts that its use from create timetable.
Solved! Go to Solution.
Hello sjb9:
In my application I ussed an OData feed to directly query the Graph (beta) API directly into PowerBi. The data is then updated when the report is refreshed. Have not yet worked with "Flow". The user is currently refreshing the reports as needed as a short term solution. Hope this helps.
= OData.Feed("https://graph.microsoft.com/beta/teams/your teams ID #/schedule", null, [Implementation="2.0"])
Anyone managed to get data from TimeCards in shifts? (clocking in and out times).
I have just tried:
https://graph.microsoft.com/beta/teams/#your teams ID #/schedule/timeCards
and got Expression.Error: Access to the resource is forbidden.
Hi @jmoreyproadata ,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. More people will benefit from here. Thanks in advance.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
Hi @jmoreyproadata ,
Currently, we can't get data from Teams directly in Power BI. We only can check usage data from Teams and view report in Teams . To make Power BI better, you can submit your request at Power BI Ideas and vote it up.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Is it possible to use the Graph API to import the shift data from TEAMS to Power BI to use as a data slicer/ filter?? This is a very typical application for manufacturing. Much needed. Is it possible? Is that the BETA of Graph has this functionality. Is there a better way
https://docs.microsoft.com/en-us/graph/api/schedule-list-shifts?view=graph-rest-beta&tabs=http
Update to my own question for other users. This does work. Use an "ODATA" connection to the Graph API ( beta ). Only the beta API has the shifts data. You can then expand the lists that are returned from the API. We are actually using the shifts time data to cross filter other data in PowerBi via a calculated column in DAX.
Hi, I am able to access all other tables except time card. I get an 'access forbidden error'. Would you mind telling what permission levels did you set in your Azure to read the time card data?
@Anonymous Can you please explain a bit more about how you moved the data retrieved from the graph into PowerBI?
On Power Automate (Flow) I can only see the add to existing data set action for PowerBI.
Did you move the retrieved data somewhere else first, like a CSV file, or did it go straight into PowerBI.
Thanks
Hello sjb9:
In my application I ussed an OData feed to directly query the Graph (beta) API directly into PowerBi. The data is then updated when the report is refreshed. Have not yet worked with "Flow". The user is currently refreshing the reports as needed as a short term solution. Hope this helps.
= OData.Feed("https://graph.microsoft.com/beta/teams/your teams ID #/schedule", null, [Implementation="2.0"])
Hi @Anonymous ,
Thanks for sharing the solution!
$clientId = "XXXXXXXXXXXXXXXXXXXX"
$clientSecret = "XXXXXXXXXXXXXXXXXXXX"
$tenantName = "XXXXXXXXXXXXXXXXXXXX"
$resource = "https://graph.microsoft.com/"
$tokenBody = @{
Grant_Type = "client_credentials"
Scope = "https://graph.microsoft.com/.default"
Client_Id = $clientId
Client_Secret = $clientSecret
}
$tokenResponse = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantName/oauth2/v2.0/token" -Method POST -Body $tokenBody
#__________________________________#__________________________________#__________________________________#_______________________________
$URL = "https://graph.microsoft.com/beta/teams/XXXXXXXXXXXXXXXXXXXX/schedule"
$result = Invoke-RestMethod -Headers @{Authorization = "Bearer $($tokenResponse.access_token)"} -Uri $URL -Method Get -ContentType "application/json"
I use PowerShell
I have a mistake
Invoke-RestMethod : {
"error": {
"code": "Forbidden",
"message": "{\"error\":{\"code\":\"Forbidden\",\"message\":\"MS-APP-ACTS-AS header needs to be set for application context requests.\",\"details\":[],\"innererror\":{\"code\":\"MissingUserIdHeaderInAppContext\"}}}",
"innerError": {
"date": "2020-06-28T17:07:59",
How can I fix this error?
MS-APP-ACTS-AS
Did You manage to solve the problem?
just add parametr "user_id" in headers
user_id who makes the requers (probably)
power query
getDataApi = Json.Document(Web.Contents("https://graph.microsoft.com/v1.0/",
[RelativePath = "teams/"&group_id &"/schedule/shifts", Headers = [Authorization = "Bearer "&token, #"MS-APP-ACTS-AS" = user_id], ManualStatusHandling={400}]))
C
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |