Forum Discussion
Count between start and end date
- 7 years ago
Hi joshcomputer1 ,
Your measure is correct however your datetable needs to be disconnected from your Test Table.
Since you have a relationship on the Start Date your data is filtered by the start date only so give you 6 as a result and not the expect outcome.
Check the image below and PBIX file attach:
Regards,
MFelix
Hi Anonymous ,
If you are using direct query then the calculation needs to be different since you are not abble to create disconnected table.
Try the following code:
DateSlicer = CALCULATE(
COUNTROWS(contractid),
FILTER(ALL(Table1),
DateTable[Date] >= [startdate] &&
DateTable[Date] <= [Enddate])Hi MFelix ,
thanks for your quick response. Not sure what you mean though. With the COUNTROWS statement I have to refer to a table and not a column and I also can't refer to the date table in this measure.
Hope you can help me
Cheers,
Marco
- MFelix2 years agoSuper User
Hi Anonymous ,
You need to reference the table that you want to filter, the column is reference on the filter statement.