Forum Discussion
Count previous 7 days
Hi
I have a table called Poperty and with a column called buld date. I need DAX to count the number of dates for the previous 7 days .
FOr the example table below I would expect the resulting count to = 7
| Table_Property |
| Date Built |
| 18/11/2019 |
| 17/11/2019 |
| 17/11/2019 |
| 14/11/2019 |
| 14/11/2019 |
| 14/11/2019 |
| 14/11/2019 |
| 10/11/2019 |
| 09/11/2019 |
| 09/11/2019 |
| 09/11/2019 |
| 09/11/2019 |
| 05/11/2019 |
| 05/11/2019 |
| 05/11/2019 |
| 05/11/2019 |
thank you
RIchard
- Anonymous6 years ago
You can use the today function in a calculate like the following:
Measure = CALCULATE ( COUNT ( 'Table'[Date Built] ); 'Table'[Date Built] >= ( TODAY () - 7 ) )Kind regards
Joren Venema
Data & Analytics Consultant
If this reply solved your question be sure to mark this post as the solution to help others find the answer more easily. - Anonymous6 years ago
Hi cottrera,
Create a measure to count dates for the past 7 days as like below,Dates_Count = CALCULATE(COUNT('Date'[Date Built]),'Date'[Date Built]>=TODAY()-7)
please find the below screenshot FYR.
DateSet:Output:Best Regards,
@Mail2inba4
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- AnonymousNot applicable
You can use the today function in a calculate like the following:
Measure = CALCULATE ( COUNT ( 'Table'[Date Built] ); 'Table'[Date Built] >= ( TODAY () - 7 ) )Kind regards
Joren Venema
Data & Analytics Consultant
If this reply solved your question be sure to mark this post as the solution to help others find the answer more easily.- cottreraPost Prodigy
Perfect thank you for the quick response
- AnonymousNot applicable
Hi cottrera,
Create a measure to count dates for the past 7 days as like below,Dates_Count = CALCULATE(COUNT('Date'[Date Built]),'Date'[Date Built]>=TODAY()-7)
please find the below screenshot FYR.
DateSet:Output:Best Regards,
@Mail2inba4
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.