Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mmace1
Impactful Individual
Impactful Individual

Error using Get-PowerBiActivityEvent - 'BadRequest'

I am a Power BI Admin, and did run Login-PowerBiServiceAccount first

Say if I run:

Get-PowerBIActivityEvent -StartDateTime 2022-04-24T12:00:00 -EndDateTime 2022-04-25T12:00:00


I receive the error: 

 

Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Admin.GetPowerBIActivityEvent

 
Not really sure how to troubleshoot...

 

1 ACCEPTED SOLUTION
matthewwi
New Member

I had this same issue today and then noticed this in the documentation:

The Get-PowerBIActivityEvent cmdlet takes a StartDateTime and an EndDateTime parameter with the same restrictions as the ActivityEvents REST API. In other words, the start date and end date must reference the same date value because you can only retrieve the activity data for one day at a time.

After I set my dates to start and end on the same day (2022-04-26 00:00:00-2022-04-26 23:59:59), then I quit receiving the error.

View solution in original post

4 REPLIES 4
Mikes2nd1
Frequent Visitor

uhg THIS is true...  I guess since it could be an insanely huge JSON file... I guess I need to run it a lot... I wish it was a 3 day window.  I would feel a little better about missing info getting caught.

 

I guess i can simply "check" to see if a day was missed and reload that single day.... I know 30 days out and its gone.

mmace1
Impactful Individual
Impactful Individual

I am a Power BI Admin, and did run Login-PowerBiServiceAccount first

Say if I run:

Get-PowerBIActivityEvent -StartDateTime 2022-04-24T12:00:00 -EndDateTime 2022-04-25T12:00:00


I receive the error: 

 

Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Admin.GetPowerBIActivityEvent

 
Not really sure how to troubleshoot...

 

matthewwi
New Member

I had this same issue today and then noticed this in the documentation:

The Get-PowerBIActivityEvent cmdlet takes a StartDateTime and an EndDateTime parameter with the same restrictions as the ActivityEvents REST API. In other words, the start date and end date must reference the same date value because you can only retrieve the activity data for one day at a time.

After I set my dates to start and end on the same day (2022-04-26 00:00:00-2022-04-26 23:59:59), then I quit receiving the error.

mmace1
Impactful Individual
Impactful Individual

oh...it has to be the same day, not just a 24 hour window.  I did not realize that, thanks!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors