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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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 )

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 )

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.