Forum Discussion
hwoehler
6 years agoHelper I
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...
- 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))
hwoehler
6 years agoHelper I
Hi amitchandak , unfortunately not. The date range is incorrect. (At the moment, all values are shown in the left graph). I would like to have only a part of it, in the screenshot it would be 7/23/2009 to 8/4/2009 (start and end date).
Best regards,hwoehler
amitchandak
6 years agoSuper User
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))