Forum Discussion

Pfoerster's avatar
Pfoerster
Helper III
5 years ago
Solved

Problem with SELECTEDVALUE

Hello,  I need again some help: I want to build up a report, where the user can select out of the Mastertable sales of a selected period and compare it to another selected period.  Here is my solu...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Pfoerster 

    Selectvalue function can only be used to single select value.

    Please try value function to get mulitiple values and use in instead of "=" in your measure.

    My sample:

    Month hist table and Month Fut table are the same.

    Measure:

     

    fut filter = 
    VAR _SelectMonthhist = VALUES('Month fut'[Month fut])
    Return
    IF(ISFILTERED('Month fut'[Month fut]),IF(MAX('Table'[Month]) in _SelectMonthhist,1,0),0)
    hist filter = 
    VAR _SelectMonthhist = VALUES('Month hist'[Month hist])
    Return
    IF(ISFILTERED('Month hist'[Month hist]),IF(MAX('Table'[Month]) in _SelectMonthhist,1,0),0)

     

    I build two table visuals to show the result. Add hit filter in filter field in one visual and set it to show items when value =1. Add fut filter in filter field in other visual and do the same option.

    Result:

    By default two visuals will show blank.

    Select Jan,Feb,Mar in Month hist and select Aug,Sep,Oct in Month fut.

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.