Forum Discussion

hwoehler's avatar
hwoehler
Helper I
6 years ago
Solved

Show Values between two dates (start/end date as measures)

Hello everybody, I would like to create a line diagram with the "Value" values ​​between two dates (StartDate and EndDate). You can see the desired result on the right chart in the picture below. Th...
  • amitchandak's avatar
    amitchandak
    6 years ago

    Try like

    Measure1 = 
    var _min = minx(SUMMARIZE(ALLSELECTED('Table'),"_a",[StartDate]),[_a])
    var _max =minx(SUMMARIZE(ALLSELECTED('Table'),"_b",[EndDate]),[_b])
    return
     CALCULATE(AVERAGE('Table'[Value]),Filter(Dim_Date,Dim_Date[Date] >= _min && Dim_Date[Date]<=_max))
    //CALCULATE(COUNTROWS('Table'),Filter(Dim_Date,Dim_Date[Date] >= _min && Dim_Date[Date]<=_max))