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.
I set up a date column and added two options if todays date (today) then Yes if not should pop up rather its not oving
Solved! Go to Solution.
Hi @Faeez ,
To calculate the count of tickets created in the last 24 hours, you can use the following DAX measure:
Tickets_Last_24_Hours =
CALCULATE(
COUNTROWS('Table'),
'Table'[Created] >= NOW() - 1
)
This measure counts the number of rows in the table where the Created datetime column is greater than or equal to 24 hours ago, as determined by the NOW() function. Replace 'Table' with the actual name of your table. Ensure the Created column is formatted as a datetime type for proper comparison. If you need a static calculation based on a specific reference datetime, replace NOW() with DATETIME(YYYY, MM, DD, HH, MM, SS).
Best regards,
Can you give more context to your problem? How your data looks like, what have you done and what does not work? Does the filter not work when you apply 'if today' option?
I am trying to build a report for a team where i am trying to fetch P1 incidents reported in last 24 hours.
can you assist with any troubleshooting step or query?
How does you data look like? Do you have only Date or dateTime?
If you see above these are the dates on which we got issues and here i am trying to implement a filter to get the count of tickets which we received in last 24 hours
Hi, @Faeez
Thanks for moncx's reply. You can try this dax to achieve your need.
Flag = IF( SELECTEDVALUE('Date'[Date]) >= (TODAY() -1) && SELECTEDVALUE('Date'[Date])<TODAY(),"Yes")
Counts = CALCULATE(COUNTROWS('Date'),FILTER('Date',[Flag] = "Yes"))
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
could you please help me with creating a DAX query for getting count of tickets created in last 24 hours using the data given below?
Incident Number | Priority | Created | Work group | Issue description |
INC-200000 | 1-critical | 2024-12-12 00:28:00 | Network L2 | Network issue |
INC-200001 | 1-critical | 2024-12-12 00:28:00 | DB L2 | DB issue |
INC-200002 | 1-critical | 2024-12-12 00:28:00 | Network L2 | Network issue |
INC-200003 | 1-critical | 2024-12-12 00:28:00 | DB L2 | DB issue |
INC-200004 | 1-critical | 2024-12-10 00:28:00 | Network L2 | Network issue |
INC-200005 | 1-critical | 2024-12-11 00:28:00 | DB L2 | DB issue |
Hi @Faeez ,
To calculate the count of tickets created in the last 24 hours, you can use the following DAX measure:
Tickets_Last_24_Hours =
CALCULATE(
COUNTROWS('Table'),
'Table'[Created] >= NOW() - 1
)
This measure counts the number of rows in the table where the Created datetime column is greater than or equal to 24 hours ago, as determined by the NOW() function. Replace 'Table' with the actual name of your table. Ensure the Created column is formatted as a datetime type for proper comparison. If you need a static calculation based on a specific reference datetime, replace NOW() with DATETIME(YYYY, MM, DD, HH, MM, SS).
Best regards,
Could you also tell me how to get the count of last 72 hours using DAX and another requirement is how to get the data for those count of data from 24hours/72 hours?
@DataNinja777 Thank you Very much, this query help me achieve the output.
you are awesome.
Hi, @Faeez
Of course, but what do you expect to achieve, you can bring out the effect you want.
Best Regards,
Yang
Community Support Team
Hello @Anonymous
i would like to achieve the count of tickets received in last 24 hours using the data i gave you.
I tried to run the DAX query you gave previously but i was getting error.
Could you try the DAX for the given data ?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |