Forum Discussion
sohaibnomani
4 years agoHelper II
Creating a Measure Start date, End date, duration
I have the following two tables, along with a Calender Table consisting of 30 calender dates (starting from 11/3/22 to 4/4/22)) with day no. (1,2,3,4,5). I have already created relationship between s...
- 4 years ago
sohaibnomani use the following measure
Measure = SUMX ( SUMMARIZE ( ADDCOLUMNS ( FILTER ( CROSSJOIN ( 'calendar', _fact ), _fact[Start Date] <= 'calendar'[Date] && _fact[End Date] >= 'calendar'[Date] ), "sum", CALCULATE ( SUM ( _dimension[Manpower] ), TREATAS ( { CALCULATE ( MAX ( _fact[Team] ) ) }, _dimension[Team] ) ) ), [Date], [Team], [sum] ), [sum] )
smpa01
4 years agoCommunity Champion
sohaibnomani based on the dataset that you provided what was the output you desired?
sohaibnomani
4 years agoHelper II
this result. on 14th EA and EB teams are also working so total count is 46
| Date | Manpower |
| 11/03/2021 | 21 |
| 12/03/2021 | 21 |
| 13/03/2021 | 21 |
| 14/03/2021 | 46 |
| 15/03/2021 | 21 |
| 16/03/2021 | 21 |
| 17/03/2021 | 21 |
| 18/03/2021 | 21 |
| 19/03/2021 | 21 |
| 20/03/2021 | 21 |
| 21/03/2021 | 21 |
| 22/03/2021 | 21 |
| 23/03/2021 | 21 |
| 24/03/2021 | 21 |
| 25/03/2021 | 21 |
- smpa014 years agoCommunity Champion
sohaibnomani use the following measure
Measure = SUMX ( SUMMARIZE ( ADDCOLUMNS ( FILTER ( CROSSJOIN ( 'calendar', _fact ), _fact[Start Date] <= 'calendar'[Date] && _fact[End Date] >= 'calendar'[Date] ), "sum", CALCULATE ( SUM ( _dimension[Manpower] ), TREATAS ( { CALCULATE ( MAX ( _fact[Team] ) ) }, _dimension[Team] ) ) ), [Date], [Team], [sum] ), [sum] )- sohaibnomani4 years agoHelper II
One thing that I missed to mension. If in the above fact table we have another entery of EA team doing two activities in a single day but different time, then the measure should count it once, rather than twice. Meanwhile i will try ur existing solution. THanks for your swift replies.
1 EMD EA 14/03/2022 09:00 14/03/2022 13:00 2 EMD EA 14/03/2022 13:00 14/03/2022 17:00 - sohaibnomani4 years agoHelper II
I am unable to select "startdate" column in expression secion of "filter" command. Please guide.