Forum Discussion

UBComma's avatar
UBComma
Icon for Helper III rankHelper III
4 years ago
Solved

Can Tabular Editor 3 read parameter values?

Does anyone know if Tabular Editor is able to read parameter values from the model?   I am creating a Power BI model that is made up primarily of parameter values that interact with each other. The...
  • johnt75's avatar
    4 years ago

    I don't think its possible for Tabular Editor to read the selections in slicers, but you can simulate it using TREATAS and variables. e.g. if you had a date slicer and a color slicer you could emulate the user selections with something like

    DEFINE
        VAR myFilter =
            TREATAS (
                { ( 2022, 6, "Red" ) },
                'Date'[Year],
                'Date'[Month number],
                'Product'[Colour]
            )
    
    EVALUATE
    SUMMARIZECOLUMNS ( 'Product'[Brand], myFilter, "Sales Amount", [Sales Amount] )

    You can use multiple filters in SUMMARIZECOLUMNS, so you could potentially have one filter per slicer rather than combining them.