How to create field parameters at the Azure Analytic services model?

S79 6 Reputation points
2022-10-18T20:09:24.9+00:00

I'm trying to create a tabular model at the Visual Studio that has field parameters at the power BI side.
I have to create the model at the visual studio and I'm not sure is this a limitation from AAS or power BI?
I found this solution but not for the Visual studio https://p3adaptive.com/2022/05/completing-the-set-up-field-parameters-using-tabular-editor/
Can you explain how to set up a field parameter at the Tabular model same as the power BI ?

Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
442 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 18,261 Reputation points
    2023-08-17T13:10:23.1666667+00:00

    Right-click on the Tables folder in the Solution Explorer and select "Add Table." Create a new table that will serve as a parameter table. This table will contain the field parameters you want to define.

    In your new parameter table, you can create columns for each parameter you want to define. You might create a "Parameter Name" column and a "Parameter Value" column, for example.

    If your parameters need to filter other tables in your model, you will need to create relationships between the parameter table and the relevant tables in your model.

    You can reference your parameters in DAX formulas by using the RELATED or LOOKUPVALUE function. For example, if you have a measure that should be calculated based on a parameter value, you could define the measure like this:

       My Measure = SUMX(FILTER(Orders, Orders[Category] = LOOKUPVALUE(Parameters[Parameter Value], Parameters[Parameter Name], "Category")), Orders[Amount])
    

    Once you've defined your parameters and any related measures or calculated columns, you'll need to deploy your model to Azure Analysis Services.

    You can after connect to your deployed model from Power BI and write queries that leverage the parameters you've defined.

    0 comments No comments