Forum Discussion

TotunG's avatar
TotunG
Icon for Resolver I rankResolver I
3 years ago
Solved

How to reference a slicer in formula

Measure = VAR SelectedValue = SELECTEDVALUE('Slicer Name') RETURN COUNTROWS(FILTER('Table','Table'[Date] = SelectedValue))   The above measure isn't working for me. I'm testing to write it into ...
  • Mikelytics's avatar
    3 years ago

    Hi TotunG ,

     

    The Syntax for SELECTEDVALUE  is :

     

    SELECTEDVALUE(TableName[ColumnName] ) or 

     

    SELECTEDVALUE(TableName[ColumnName]Alternative Result ) Alternative Result comes when multiple or no value is selected in column.

     

    So you need to put the table and column which you put into the slicer you want to refer to.

     

    SELECTEDVALUE-Funktion - DAX | Microsoft Learn

     

    Best regards
    Michael
    -----------------------------------------------------
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Appreciate your thumbs up!
    @ me in replies or I'll lose your thread.