Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have some data in the following format:
Incident Number | Date Occurred | Incident Name |
143 | 1/1/2001 12:00 | ex 1 |
361 | 1/2/2001 14:00 | ex 2 |
I am trying to count the number of incidents that have a [Date Occurred] within a certain time frame relative to the current date. I want the number of incidents with a [Date Occurred] between 7 days ago after 12:00 PM to today before 12:00 PM.
To give an example: if it is Thursday today, I would like to count the number of incidents with a [Date Occurred] between LAST thursday after 12:00 PM and 12:00 PM this Thursday (today).
Ideally, I would like a measure to get this count.
Thanks!
Hi @Anonymous
Try this measure in a card visual:
Measure = VAR Today12_ = TODAY () + ( 12 / 24 ) //Add 12 hours VAR Beginning_ = Today12_ - 7 // Subtract 7 days RETURN CALCULATE ( COUNTROWS ( Table1 ), Table1[Date Occurred] >= Beginning_, Table1[Date Occurred] < Today12_ )
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |