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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors