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

Lookup based on start and end date/time

HI, 

I have one table containing rules for conversion of local date/time to UTC time zone format. What I want to do is to convert local times in second table (from known time zone) into UTC time zone format, using rules of first table. Please advice how to do this in PQ? I tried creating  List of all dates/times (yyyy/mm/dd hh:mm:ss AM/PM format) within ranges (rules table), and then do the merge, but such method takes too long. Thanks

Tables 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @tomislav ,

 

We can achieve that by DAX.

Column = 
VAR a =
    - CALCULATE (
        MAX ( RULES[OffsetFromUTC_ForLocalTime] ),
        FILTER (
            RULES,
            RULES[EndOfTimeZoneOffset] >= 'TABLE TO CONVERT'[CreatedDate]
                && RULES[StartOfTimeZoneOffset] <= 'TABLE TO CONVERT'[CreatedDate]
        )
    )
RETURN
    'TABLE TO CONVERT'[CreatedDate] + TIME ( a, 0, 0 )

Capture.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @tomislav ,

 

We can achieve that by DAX.

Column = 
VAR a =
    - CALCULATE (
        MAX ( RULES[OffsetFromUTC_ForLocalTime] ),
        FILTER (
            RULES,
            RULES[EndOfTimeZoneOffset] >= 'TABLE TO CONVERT'[CreatedDate]
                && RULES[StartOfTimeZoneOffset] <= 'TABLE TO CONVERT'[CreatedDate]
        )
    )
RETURN
    'TABLE TO CONVERT'[CreatedDate] + TIME ( a, 0, 0 )

Capture.PNG

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.