Forum Discussion
hnazzal
4 years agoNew Member
Get count between start and end date
Hello, I have a list of projects, each project has an item, I need to calculate the count of items for all those projects START in specific Start Date OR Finish in specific finish date within sam...
- 4 years ago
hnazzal Okay then you can try like below or you can share your PBIX file after removing sensitive data:-
_Attendees = var start_date = min(calender[date]) var end_date = max(calender[date]) return SUMX ( FILTER ( 'Table (6)', OR ( ( MONTH ( 'Table (6)'[Start Date] ) = month(start_date) && YEAR ( 'Table (6)'[Start Date] ) = year(start_date) ), ( MONTH ( 'Table (6)'[End Date] ) = month(end_date) && YEAR ( 'Table (6)'[End Date] ) = year(end_date) ) ) ), [Attendees count] ) - 4 years ago
Thank you, i will try this code
But what do you mean by
[Attendees count]
hnazzal
4 years agoNew Member
I tried this code, but unfortunately, it doesn't work
BTW, the start date and end date will be dynamic, I mean to be in the slicer to allow users to pick the start and end date.
I created a calendar date to be user bu again it doesn't works with me 😞
Thank you,
Samarth_18
Community Champion
4 years agohnazzal Okay then you can try like below or you can share your PBIX file after removing sensitive data:-
_Attendees =
var start_date = min(calender[date])
var end_date = max(calender[date])
return SUMX (
FILTER (
'Table (6)',
OR (
(
MONTH ( 'Table (6)'[Start Date] ) = month(start_date)
&& YEAR ( 'Table (6)'[Start Date] ) = year(start_date)
),
(
MONTH ( 'Table (6)'[End Date] ) = month(end_date)
&& YEAR ( 'Table (6)'[End Date] ) = year(end_date)
)
)
),
[Attendees count]
)