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
RK9009
Frequent Visitor

LIST DATE TIME/ PowerQuery / Dax

Greetings Everyone, 

 

I am trying to solve a situation, not very successful at it until now. Can we get a list of date and time in power query or with dax. 

below is the example for what I am trying to achive. 

 

personIdstartdatestarttimeenddateendtimelocation
112/13/202010:19 PM12/15/20203:08 PMA
112/15/20203:08 PM12/16/202010:42 AMB
112/16/202010:42 AM12/23/20204:00 PMB

 

I am trying get a list of date and time for multiple personID to calculate the distinct count at a location based on a given date time. i.e Everyday as of 5:00 am 

 

to put this in a simple context I want to count this personID at one location as of 5 am between the start and end date. 

 

Any help is much appriciated and thank you so much as always. 🙂

 

Dax Help

@PowerQueryFTW 

@dax

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RK9009 , Try a new column in Dax like

 

new column =
var _1 = date(year([enddate]),month([enddate]),day([enddate])) + time(5,0,0)
return
if( (_1 <=[enddate] && _1 >= [starttime]) && (_1-1 <=[enddate] && _1-1 >= [starttime]) ,"Yes", "No")

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

new column =
var _1 = date(year([enddate]),month([enddate]),day([enddate])) + time(5,0,0)
return
if( (_1 <=[enddate] && _1 >= [starttime]) ||  (_1-1 <=[enddate] && _1-1 >= [starttime]) ,"Yes", "No")

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
amitchandak
Super User
Super User

@RK9009 , Try a new column in Dax like

 

new column =
var _1 = date(year([enddate]),month([enddate]),day([enddate])) + time(5,0,0)
return
if( (_1 <=[enddate] && _1 >= [starttime]) && (_1-1 <=[enddate] && _1-1 >= [starttime]) ,"Yes", "No")

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

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.