Forum Discussion

tonyc's avatar
tonyc
Frequent Visitor
2 years ago

SELECTEDVALUE in filter not working

why can't I reference SELECTEDVALUE in my filter?  when I hardcoded is fine.


Voting Entitlement =

VAR selectedValue  = SELECTEDVALUE('Date'[FiscalRange])

var cal = CALCULATETABLE(
   SUMMARIZE(
    FILTER (
            FI_Details,
            FI_Details[Framework]="ABC" &&
            ( FI_Details[Membership]="AA" ) &&
            FI_Details[Status]="Active" &&
            FI_Details[startMergedDate] = "-" &&
            FI_Details[startMergingDate] = "-"  &&  
            FI_Details[startInactiveDate] = "-" &&
    --        FI_Details[period]=selectedValue &&
             SEARCH(selectedValue,  FI_Details[period],1,0) >1
      --      FI_Details[period]="JUL22 - JUN23"
            ),
    FI_Details[FI_ID],
    FI_Details[Primary_Mnemonic],
    FI_Details[FI_Name],
    FI_Details[Voting_Group],
     FI_Details[period]
   
)

)

RETURN
cal

2 Replies

  • quick check you can do, create temp measure and display the value (in the table or matrix or ...).

    SELECTEDVALUE('Date'[FiscalRange])

     

    and compare the format/value between your hard coded value vs selectedvalue(...) for FI_Details[period]

  • v-weiyan1-msft's avatar
    v-weiyan1-msft
    Icon for Community Support rankCommunity Support

    Hi tonyc ,

     

    Did you follow the method provided by sevenhills  to check it?
    If possible, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and assist you.

     

    Best Regards,
    Yulia Yan