Forum Discussion

xti224's avatar
xti224
Regular Visitor
4 years ago
Solved

sort custom column

  • Hi, xti224 

    Try to create a measure like this:

    isShow = 
    var _selectedDate=SELECTEDVALUE(Date1[Date])
    var _45=IF(SELECTEDVALUE(Table1[Date])<=_selectedDate&&SELECTEDVALUE(Table1[Date])>=_selectedDate-45,1,0)
    return _45

    And filter items with the measure equal to 1 in the filter pane

    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    It sounds like what you want is in Table 1, you pick one date, then in some visual, you show results from Table 2 that fall within the time frame Table 1 Date -45 to Table 1 Date, right? Are you using this to filter? If so, this could fit your needs. You'd just filter to where the measure is 1. 

    VAR Minus45 = maxx('table1' , dateadd('table1'[Date2],-45, DAY))
    RETURN
    IF (
        SELECTEDVALUE ( table2[Date1] ) <= MAX ( 'table1'[Date2] )
            && SELECTEDVALUE ( table2[Date1] ) >= Minus45 ,
        1,
        0
    )



    • xti224's avatar
      xti224
      Regular Visitor

      I need whatever the user selects for date1 (ex. 11/30/2021) to return the same date that is used on the visual  date2 and anything else in the last 45 days (return values ex. 10/15/2021 to 11/30/2021) but these are two separate table fields. and Yes date1 would be a dropdown list for the user to select a date

      • Anonymous's avatar
        Anonymous
        Not applicable

        So I think what I wrote above would fit you needs, except that Date2 should be Date1

  • Hi, xti224 

    Try to create a measure like this:

    isShow = 
    var _selectedDate=SELECTEDVALUE(Date1[Date])
    var _45=IF(SELECTEDVALUE(Table1[Date])<=_selectedDate&&SELECTEDVALUE(Table1[Date])>=_selectedDate-45,1,0)
    return _45

    And filter items with the measure equal to 1 in the filter pane

    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


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