Forum Discussion

GMichaud's avatar
GMichaud
Helper I
5 years ago
Solved

Choose between segment dates and fixed dates based on condition

Hello community! It seems I can't come up with the right words for my question, so here is a new post for this. I need to be able to choose between using the minimum and maximum segment dates and u...
  • amitchandak's avatar
    5 years ago

    GMichaud , Based what I got

    Measure =
    var _1= DATEDIFF(MIN(dimCalendar(TheDate), MAX(dimCalendar(TheDate), DAY)
    return
    if(_1<30, 30, _1)

     

    When you need sum of avg

     

    Measure =
    var _1= DATEDIFF(MIN(dimCalendar(TheDate), MAX(dimCalendar(TheDate), DAY)
    return
    AverageX(values(Table[Segmenr]) , if(_1<30, 30, _1))