Forum Discussion

SeGr's avatar
SeGr
Icon for Helper I rankHelper I
4 years ago
Solved

need help for creating a custom date horizon

Hi team,   I have a request to create a custom date horizon. What does this mean? I am working with forecast snapshots. For instance, if I select this week's snapshot, I will see the forecast for t...
  • v-xiaotang's avatar
    4 years ago

    Hi SeGr 

    Thanks for reaching out to us.

    you can try this measure

    filtermeasure = 
    var _week1=MINX(ALLSELECTED(weeks),[value])
    var _week2=MAXX(ALLSELECTED(weeks),[value])
    var _date1= MINX(ALLSELECTED('calendar'),[Date])
    var _date2= MAXX(ALLSELECTED('calendar'),[Date])
    var _date3= _date1+_week1*7
    var _date4= _date2+_week2*7
    return 
    IF(MIN('Table'[date]) >=_date3 && MIN('Table'[date])<=_date4,1,0)

     

     

    Best Regards,

    Community Support Team _Tang

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