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
Anonymous
Not applicable

Displaying Date with time in slicer

I have start date time and end date  time on my report i want to display below conditions in my report.

EVENT_START_DATETIME <= today date and time (user input date time)
EVENT_END_DATETIME >= today date and time (user input date time)2-52.PNG
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , A measure like the given example. where date filter might come from an independent date table ( or we need to do necessary changes )

 

measure =
var _max = maxx(allselected('Date'), 'Date'[Date])
return
calculate(countrows(Table) , filter ( Table, (Table[EVENT_START_DATETIME] <= Today() && Table[EVENT_START_DATETIME] <=_max) && (Table[EVENT_END_DATETIME] >= Today() && Table[EVENT_END_DATETIME] >=_max)))

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

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , A measure like the given example. where date filter might come from an independent date table ( or we need to do necessary changes )

 

measure =
var _max = maxx(allselected('Date'), 'Date'[Date])
return
calculate(countrows(Table) , filter ( Table, (Table[EVENT_START_DATETIME] <= Today() && Table[EVENT_START_DATETIME] <=_max) && (Table[EVENT_END_DATETIME] >= Today() && Table[EVENT_END_DATETIME] >=_max)))

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
Anonymous
Not applicable

Hi Amit, i have tried this measure but its not giving proper results and returning numbers. Here am pulling data from view  and i dont have date table in my report.

StartEnDTiMe =
var _max = maxx(allselected('egama NGESO_PreBuilt_OLTA_BMU'), 'egama NGESO_PreBuilt_OLTA_BMU'[EVENT_START_DATETIME])
return
calculate(countrows('egama NGESO_PreBuilt_OLTA_BMU') , filter ( 'egama NGESO_PreBuilt_OLTA_BMU', ('egama NGESO_PreBuilt_OLTA_BMU'[EVENT_START_DATETIME] <= Today() && 'egama NGESO_PreBuilt_OLTA_BMU'[EVENT_START_DATETIME] <=_max) && ('egama NGESO_PreBuilt_OLTA_BMU'[EVENT_END_DATETIME] >= Today() && 'egama NGESO_PreBuilt_OLTA_BMU'[EVENT_END_DATETIME] >=_max)))

 

vdi.PNG

Anonymous
Not applicable

@amitchandak  do you have any idea to write above expression in power bi

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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