Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help.. Selectedvalue issue / chart

I am trying to achieve TOP & keep getting BOTTOM (error).   DAX used: Var Y2021 = ... return if(selectedvalue('Date'[Month]) > 3*, blank(), Y2021)  *Edited   I will get "TOP" (desired)...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  Anonymous ,

    I created the data:

    Table:

    Date Table:

    Here are the steps you can follow:

    1. Create meausre.

    Total = SUMX(FILTER(ALL('Table'),'Table'[Month]=MAX('Date'[Month])),'Table'[amount])

    Result:

    Flag =
    var _selectvalue=SELECTEDVALUE('Slice'[Month])
    return
    IF(MAX('Date'[Month]) <=_selectvalue,1,0)

    2. Use enter data to create a Slice table.

    3. Set the Month of the Slice table as the slicer.

    4. Put Flag into Filter, set is =1, and apply filter.

    5. Result.

    When the slicer is 3, the data of the previous three months is displayed.

     

    Best Regards,

    Liu Yang

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