Forum Discussion

VickyDev18's avatar
VickyDev18
Advocate II
2 years ago
Solved

Field Parameters in Reference Labels in the new Card visual not working

Let's say I have 6 metrics  Sales, COGS, Sales This Year, COGS This Year, Sales Last Year, COGS Last Year.    I want the user to have 2 slicers 1. To choose between Sales or COGS 2. To choose bet...
  • MFelix's avatar
    2 years ago

    Hi VickyDev18 ,

     

    Currently you cannot use field parameters in the reference or the card since has you can see it will return the first value and not the value itself for this you need to create a switch measure:

    Reference = SWITCH( TRUE(),
        SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  0 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =0 , [Sales This Year],
        SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  0 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =1 , [Sales Last Year],
        SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  1 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =0 , [COGS This Year],
        SELECTEDVALUE(_Param_Metric[_Param_Metric Order]) =  1 && SELECTEDVALUE(_Param_CompareTo[_Param_ComapreTo Order])  =1 , [COGS Last Year])
    

     

    See PBIX file attach.