Forum Discussion
Anonymous
8 years agoNot applicable
Using ALLEXCEPT or ALL not working
Hello, Need some help with DAX please. I need to count [Number of Active Awards] within a financial period. Then slice this measure by any dimension in the model, not only dates. Here's part ...
- Anonymous8 years ago
The pattern you use for solving the "events in progress" requires that you don't have any active relationship with the date table.
If you inactivate the second relationship between Awards and Dates and then use this measure it will give you the active awards within the min/max dates.
Total Active Awards = VAR MaxPeriod = MAX( dates[Cal Date] ) VAR MinPeriod = MIN( dates[Cal Date] ) RETURN CALCULATE( COUNTROWS( awards ), FILTER ( awards,
awards[Award Start Date] <= MaxPeriod && awards[Award End Date] >= MinPeriod ) )There are several good articles written on the subject of "events in progress".
Br,
Magnus
DAX0110
8 years agoResolver V
mmm... OK, my bad, maybe this would work:
Total Active Awards = VAR MaxPeriod = MAX( dates[Cal Date] ) VAR MinPeriod = MIN( dates[Cal Date] ) RETURN CALCULATE( COUNTROWS( awards ), ALL(awards[Award Start Date]),
awards[Award Start Date] <= MaxPeriod, awards[Award End Date] >= MinPeriod )
Anonymous
8 years agoNot applicable
DAX0110 this still doesn't work, returning lesser rows than expected.