Search code examples
powerbi-embedded

Power Bi filtered export API is not working


I am working on a embeded powerbi within salesforce where i am using filtere which doing a export of file using rest api. The filter json looks like below . This is passed in the body of the POST request callout

{
    "format": "PDF",
    "powerBIReportConfiguration": {
        "ReportLevelFilters": [
            {
                "Filter": "User / Id in ('0055700000633IsAAI')"
            }
        ]
    }
}

Endpoint which i am calling is

https://api.powerbi.com/v1.0/myorg/groups/XXXX-XXXX-XXXX-XXXX/reports/XXXX-XXXX-XXXX-XXXX/ExportTo

When the file is getting downloaded , i am getting all the data instead the filtered data. Anyting i am missing in the configuration


Solution

  • Take the spaces out of the Table/Column expression, per the examples here, also some of your JSON names don't have the correct case. Here's the Fiddler capture of a successful request using the Power BI .NET Client:

    {
      "format": "PDF",
      "powerBIReportConfiguration": {
        "reportLevelFilters": [
          {
            "filter": "DimCustomer/CustomerAlternateKey in ('AW00011000')"
          }
        ]
      }
    }
    

    So something like

    {
        "format": "PDF",
        "powerBIReportConfiguration": {
            "reportLevelFilters": [
                {
                    "filter": "User/Id in ('0055700000633IsAAI')"
                }
            ]
        }
    }