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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Did record happen during day or night?

Hi,

 

I would like to see if my transaction records happened during daylight or during the night - so the time changes for date to date.

 

Table 1 - named 'Counts',
with a [Date] and a [Time] column

 

Table 2 - name 'SunUpDown'

with a [Date], [SunUpTime] and [SunDownTime]

 

Can anyone please help me how I can make a calculated Column in Table 1, for each record to tell me if it happened during the day or night, on that specifical date.

 

2 REPLIES 2
jthomson
Solution Sage
Solution Sage

Assuming there's a relationship between the two date fields - I'd have thought it'd just be a case of just doing a two stage if:

 

if([Time]<[SunUpTime],"Night",if([Time]>[SunDownTime],"Night","Day"))

Anonymous
Not applicable

I start to suspect that I have made an error in the linking of the tables; as I get the same error as I have gotten during my tests too:

Table 1, with new calculated columnTable 1, with new calculated columnLink between tablesLink between tablesTable 2Table 2

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
Top Kudoed Authors