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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power BI Template Dynamic Query Formula.Firewall Error

Hello,

 

I am trying to create a template that asks users to input parameters where these parameters are populated using different stored procedures.

 

My first step was to create these parameters with Query option, then create the report and export a template to be shared. As many have experienced, I was having difficulty with the usual and famous Formula.Firewall error. There are plenty of cases of this error here on the forums and also over the internet different people talking about it for Excel as well as Power BI. In my case, using  Value.NativeQuery() as suggested by Chriss Webb on his blog post series about Data Privacy in Power BI solved all of my problems. In the end, I ended up factoring my query as follows.

 

let
    Param_List = [EntityParam = Entity, LedgerParam = Ledger, PeriodParam = #"From Period", AccountParam = Account],
    Source = Sql.Database("<server_name>", "<database_name>"),
    Query = Value.NativeQuery(Source, 
        "EXEC [addin].[BI_TEST_AgedTrialBalance_Monthly]
            @EntityCode = @EntityParam,
            @LedgerCode = @LedgerParam,
            @FromLongPeriod = @PeriodParam,
            @AccountCode = @AccountParam",
            Param_List
    )
in
    Query

From here on changing the parameter values worked perfectly and I am able to retrieve the correct data. 

 

However, exporting a template from this Power BI file did not go so smoothly. Launching/importing from template from a new Power BI file starts with no problems.  All the parameter values are population correctly with no error. Screenshot below.2019-02-05 15_19_55-Untitled - Power BI Desktop.png

When I fill in all the parameters and click load, I get the famous  Formula.Firewall again. 2019-02-05 15_23_13-Untitled - Power BI Desktop.png

Closing this and going into Edit Queries and Refreshing the data however works perfectly with no error.

 

I do not understand why this is happening. Everything works fine in the original Power BI file but when trying to load the data initially into a template, it does not work. Has anyone experienced something similar to this?

 

I would appreciate any help or tips on this.

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at post below.

https://community.powerbi.com/t5/Desktop/Pass-List-Query-Parameter-Value-into-Another-SQL-Server-Sto...

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for the reply @v-chuncz-msft.

 

Privacy isolation levels is the main reason I have refactored the query to bypass that particular problem. However, I do not want to change the privacy levels. 

 

I am trying to figure out why everything works in the PBIX file but does not work when exported to a template.

 

Do you think when using one single data source like in my case it is safe to ignore privacy levels?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.