Forum Discussion
Count for last 24 hours
- 7 years ago
Hi Hicham,
I have a solution that you can try.
You need to create a calculated column next to your date time. You can call it Hours ago.It should look like this:
Hours ago = /*Years*/ (YEAR(NOW())-YEAR('Date'[Date]))*8760 + /*Month*/ (MONTH(NOW())-MONTH('Date'[Date]))*720 + /*Days*/ (DAY(NOW()) - DAY('Date'[Date]))*24 + /*Hours*/ HOUR(NOW())-HOUR('Date'[Date])This will calculate the numbers of hours since todays date and time.
Of course you should switch the 'Date'[Date] with your datetime column unless you have a data model with a date table as well.
Then simply add this Hours ago column to the visual that contains your count measure.If you don't have a count measure it could look like this:
No. of names := CALCULATE(DISTINCTCOUNT('Yourtablename'[Name Tasks]))Best regards
Kaj
Hi Hicham,
I have a solution that you can try.
You need to create a calculated column next to your date time. You can call it Hours ago.
It should look like this:
Hours ago =
/*Years*/
(YEAR(NOW())-YEAR('Date'[Date]))*8760 +
/*Month*/
(MONTH(NOW())-MONTH('Date'[Date]))*720 +
/*Days*/
(DAY(NOW()) - DAY('Date'[Date]))*24 +
/*Hours*/
HOUR(NOW())-HOUR('Date'[Date])This will calculate the numbers of hours since todays date and time.
Of course you should switch the 'Date'[Date] with your datetime column unless you have a data model with a date table as well.
Then simply add this Hours ago column to the visual that contains your count measure.
If you don't have a count measure it could look like this:
No. of names := CALCULATE(DISTINCTCOUNT('Yourtablename'[Name Tasks]))
Best regards
Kaj