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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.