Hello once again EDNA - worked on this for a while and unable to come up with a answer. I have two measures.
- Counts distinct widget aging 90 days or less.
90 Days =
VAR LastSelectedDate = MAX (CalFree[Date])
RETURN
CALCULATE (
DISTINCTCOUNT ( TH[TNo]),
FILTER (
SUMMARIZE (
TH,
TH[EffDDate],
TH[EDate]
),
INT (
IF (
TH[EffDDate] < LastSelectedDate,
TH[EffDDate],
LastSelectedDate
)
- TH[EDate]
)
<91
),
TH[EDate] < LastSelectedDate,
TH[EffDDate] > LastSelectedDate
)
- Averages the number of days for all aging widgets.
DaysAging =
VAR LastSelectedDate = MAX (CalFree[Date])
RETURN
CALCULATE (
AVERAGEX(TH,
1.*(IF(ISBLANK(TH[DDate]), LastSelectedDate-TH[EDate],
TH[DDate]-TH[EDate]
)
)+1
),
KEEPFILTERS ( TH[EDate] < LastSelectedDate ),
KEEPFILTERS ( TH[EffDDate] > LastSelectedDate)
)
I’m looking for the average days of the 90 days group and the 120 group and so on.
My attempt at combining these two measures:
Avg Days Aging 90 Days =
VAR LastSelectedDate = MAX( CalFree[Date] )
RETURN
CALCULATE (
AVERAGEX(TH,
1.*(IF(ISBLANK(TH[DDate]), LastSelectedDate -TH[EDate],
TH[DDate]-TH[EDate]
)
)+1
),
FILTER (
SUMMARIZE (
TH,
TH[EffDDate],
TH[EDate]
),
INT (
IF (
TH[EffDDate] < LastSelectedDate ,
TH[EffDDate],
LastSelectedDate
)
- TH[EDate]
)
<91
),
KEEPFILTERS ( TH[EDate] < LastSelectedDate ),
KEEPFILTERS ( TH[EffDDate] > LastSelectedDate )
)
didn’t work for me. the farther I went back in time with the date slicer, the number of days went higher then 90 days avg. If I’m trying to get the avg. days of the 90 days group , it should stay below 90 days.
Thanks for your time in advance,
Frankee.