Forum Discussion
SUM between two dates referencing Date table
- 4 years ago
HelloTom , In this case, do not join the date table with any date or keep the join inactive
try measure like
BatteriesAvailable =
var _max = MAXX(Allselected(DIM_Date), DIM_Date[Date])
return
SUMX(
FILTER(
FACT_Battery,
FACT_Battery[DateKey (Date_Built)] >=_max
&&
FACT_Battery[Date_EndOfLife(5days)] <= _max
)
,FACT_Battery[BatteriesBuilt]
)Also refer this, how to handle inactive joins
HelloTom , In this case, do not join the date table with any date or keep the join inactive
try measure like
BatteriesAvailable =
var _max = MAXX(Allselected(DIM_Date), DIM_Date[Date])
return
SUMX(
FILTER(
FACT_Battery,
FACT_Battery[DateKey (Date_Built)] >=_max
&&
FACT_Battery[Date_EndOfLife(5days)] <= _max
)
,FACT_Battery[BatteriesBuilt]
)
Also refer this, how to handle inactive joins
- HelloTom4 years agoMicrosoft Employee
The above link you provided to post you have on this type of scenario was helpful, thank you! The above DAX didn't return the exact desired outcome but I was able to figure it out based on the DAX you posted and your link provided. Thank you again.