Forum Discussion

SPBKA's avatar
SPBKA
Frequent Visitor
2 years ago
Solved

How to achieve same functionality as field parameters by writing DAX?

Hi All,

 

As "field parameter" option is not available in PBIRS desktop version. I'm trying to achieve same functionality by writing DAX. But no success.

 

Googled and searched in forums, can't find relevant answer.

 

I have created a reference "Selection_Table" as below

 

 

MY DAX looks something like this:
-----

Selected Values =
VAR SelectedDim = SELECTEDVALUE(Selection_Table[DimColumn])
RETURN
    SWITCH(
        SelectedDim,
        "Category", SELECTEDVALUE('Dim Category'[Category]),
        "Country", SELECTEDVALUE('Dim Country'[Country]),
        "Date", SELECTEDVALUE('Dim Date'[Date]),
        BLANK()
    )
 
I'm getting an error and not sure if this can be possible with DAX.
 
Regards,
SPB