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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Building API Error: Formula.Firewall: Query (step 'Source') references other queries or steps

I am new to Power Query / Mashup and have been trying to build an API call (code below). I believe I finally have the code formatted properly but I am getting the Formula.Firewall: Query references other queries error. I did some extensive searching on this and, yes, I see several threads that link back to this article - but I've already attempted this in my solution below. I broke out multiple sources so that my bearer query is different. (The "ChoiceBearerTokenGet" returns the (very long) token. The screenshot of the "myBody" variable is in the screenshot below my code.

 

Any help would be appreciated!

 

 

 

let
    myBearerVariable = ChoiceBearerTokenGet,
    Date = Date.ToText(#date(Date.Year(DateTime.LocalNow()),Date.Month(DateTime.LocalNow()),Date.Day(DateTime.LocalNow())),"yyyy-MM"),
    myUrl = "https://licensing-eastus-release-b.citrixworkspacesapi.net/ChoiceSoluti/licenseusages/deployments/cloud/memberships/csp/products/cvad?date="&Date,
    myTokenHeader = "CwsAuth Bearer=" & myBearerVariable,
    myBody = "{
                ""authorization"": """& myTokenHeader & """,
                ""content-type"": ""application/json"",
                ""Accept"": ""application/json""
            }",
    Source = Json.Document(
            Web.Contents(
                myUrl,
                [
                    Headers = Json.Document(myBody)
                ]
            )
    ),
    singleTenantsUsage = Source[singleTenantsUsage],
    #"Converted to Table" = Table.FromList(singleTenantsUsage, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"customerId", "orgId", "displayName", "editionName", "totalCommitCount", "totalUsageCount", "totalOverageCount", "totalUsagePercent"}, {"Column1.customerId", "Column1.orgId", "Column1.displayName", "Column1.editionName", "Column1.totalCommitCount", "Column1.totalUsageCount", "Column1.totalOverageCount", "Column1.totalUsagePercent"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"Column1.displayName", "Company"}, {"Column1.editionName", "sku"}, {"Column1.totalCommitCount", "totalCommitCount"}, {"Column1.totalUsageCount", "totalUsageCount"}, {"Column1.totalOverageCount", "totalFlexCount"}, {"Column1.totalUsagePercent", "totalUsagePercent"}, {"Column1.orgId", "CitrixCompanyorgId"}, {"Column1.customerId", "CitrixCustomerId"}})
in
    #"Renamed Columns"

 

 

 picture.jpg

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

Check this topic see if it's helpful.

https://community.powerbi.com/t5/Power-Query/Formula-Firewall-Error/m-p/1061155 

 

Best Regards,

Jay

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.