Forum Discussion

Panto's avatar
Panto
Helper I
6 years ago
Solved

Different Periods in same Line Chart starting from the same point

Hi community,   I'm dealing with time intelligence functions and I'm facing a challenge when it comes to let the final user selecting 2 different time periods with the final result that should be v...
  • amitchandak's avatar
    6 years ago

    Panto , you need to have a date table connected with your table and another disconnected date table. The first formula will consider period 1 which on date table. As it joined you Measure will work

     

    Measure = Calculation<>....

     

    The second period will come from the disconnected table Date1, we will not use this in join just move the date

    new measure =
    var _min = minx(allselected(Date),Date[Date])
    var _min1 = minx(allselected(Date1),Date[Date])
    var _diff = datediff(_min1,_min,Day) // You may have try datediff(_min,_min1,Day)

    return
    calculate([measure], dateadd(Date[Date],_diff,day))