Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
danny_tym
Frequent Visitor

Countifs to filter if date = today()

Hi guys,

 

     Need your help with a newbie coming across from Excel.

 

     I need DAX to count if the entries were based on today.

danny_tym_2-1633409929564.png

 

     I've tried using Calculate along with Filter as I understand that's the alternative to Countifs so my DAX function were as follows:

 

danny_tym_3-1633409981485.png

 

    Would appreciate any help where I've gone wrong.

 

    I like to also create new measures based on the hour, for example, 8am - 9am, etc.

 

    Thanks in advance!

 

Cheers,

DT

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@danny_tym , Create a date without timestamp

 

example

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

 

Then it can work with today

 

or change filter like

filter(log, log[datetimeconerter] >=Today && log[datetimeconerter]  <today() +1 )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@danny_tym , Create a date without timestamp

 

example

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

 

Then it can work with today

 

or change filter like

filter(log, log[datetimeconerter] >=Today && log[datetimeconerter]  <today() +1 )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the prompt response.

 

I added the extra column 'Date' through Power Query. 

 

Edit the formula and it turn up with this error:

 

danny_tym_0-1633412959881.png

Any help would be appreciated.

 

Thanks,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.