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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

0

PowerShell ExportFilter not being applied on the output extract

My exportfilter for PowerBIReportConfiguration is not being applied on the output extract,can someone help where i have gone wrong

 


$filter1 = "Tech"

#REPORT CONFIGURATION
$bodyExport = "{`"format`":`"pdf`",
`"powerBIReportConfiguration`": { `"reportLevelFilters`": [{ `"filter`": `"AzureADUserProperties/Department in ($filter1) `" }]}
}"

$Folder = "c:\temp\"
$filename = $Folder + "PowerBIMetrics.pdf"

 


#Reports - Export To File In Group - Run the Job
try {
$url1 = "https://api.powerbi.com/v1.0/myorg/groups/$groupid/reports/$Reportid/ExportTo"
$FileExport = Invoke-RestMethod -Method Post -uri $url1 -Headers $authHeader -body $BodyExport
$id = $FileExport.id
}

Status: Delivered

Hi @EricShahi ,

 

Glad you solved the problem, I will change the status to DELIVERED.

 

Best regards,

Community Support Team Selina zhu

Comments
EricShahi
Helper IV

Below is the code for easy reading, the filter "Tech" is not being applied on the ooutput extract.

 

EricShahi_0-1665676024168.png

EricShahi_0-1665676594603.png

 

EricShahi
Helper IV

Hi ,

 

Are you able to help me on this ? 

 

@GilbertQ  @v-kkf-msft 

v-mengzhu-msft
Community Support
Status changed to: Investigating

Hi @EricShahi ,

 

About filter in power shell, you can refer to this doc, hope it can help you:

PowerShell Filter | Guide to Different Types of PowerShell Filter (educba.com)

 

Best regards,

Community Support Team Selina zhu

EricShahi
Helper IV

@v-mengzhu-msft 

 

Thanks for your reply, finally found a solution for this that makes my filter working.

 

 

v-mengzhu-msft
Community Support
Status changed to: Delivered

Hi @EricShahi ,

 

Glad you solved the problem, I will change the status to DELIVERED.

 

Best regards,

Community Support Team Selina zhu