Forum Discussion
Need help to filter data in grid based on active date
- 7 years ago
Hi Anonymous ,
By my tests based on your data sample, I'm afraid that your logic should be right.
Assuming that I have the table like this and want to calculate the count of ID which is filtered by the slicer.
I also create a calendar table with your formula and do not create the relationship for the two tables.
Date = CALENDAR(date(YEAR(MIN(Employment[Employment start])),1,1),DATE(YEAR(MAX(Employment[Employment end])),12,31))
Then I create the measure below.
NosOfFTE = CALCULATE ( COUNT( 'Employment'[ID] ), FILTER ( Employment, Employment[Employment start] <= SELECTEDVALUE ( 'Date'[Date]) && Employment[Employment end] >= SELECTEDVALUE ( 'Date'[Date] ) ) )Here is the test output.
Best Regards,
Cherry
Hi Anonymous ,
By my tests based on your data sample, I'm afraid that your logic should be right.
Assuming that I have the table like this and want to calculate the count of ID which is filtered by the slicer.
I also create a calendar table with your formula and do not create the relationship for the two tables.
Date = CALENDAR(date(YEAR(MIN(Employment[Employment start])),1,1),DATE(YEAR(MAX(Employment[Employment end])),12,31))
Then I create the measure below.
NosOfFTE =
CALCULATE (
COUNT( 'Employment'[ID] ),
FILTER (
Employment,
Employment[Employment start] <= SELECTEDVALUE ( 'Date'[Date])
&& Employment[Employment end] >= SELECTEDVALUE ( 'Date'[Date] )
)
)
Here is the test output.
Best Regards,
Cherry
- Anonymous7 years agoNot applicable
Hi v-piga-msft,
Thank you for your response. I think the issue is with me about date slicer only. I used date slicer between option. If I use list then it should work. I will check with List and let you know result.
Kind regards,
Parag