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! Learn more

Reply
Anonymous
Not applicable

Vlookup next row on sorted table

Hi Community,

 

Looking for help for this problem. I have one table containing Visitor ID, Date/Time and Sensor.

 

I want to calculate which sensor the Visitor ID moved to next, so I can do a flow diagram (highlighted in yellow below)

 

Any ideas?

SnipImage.JPG

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @Anonymous

 

Try this calculated Column

 

Sensor to =
VAR NextTime =
    CALCULATE (
        MIN ( Table1[Time] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Date], Table1[Visitor_ID] ),
            Table1[Time] > EARLIER ( Table1[Time] )
        )
    )
RETURN
    CALCULATE (
        FIRSTNONBLANK ( Table1[Sensor], 1 ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Date], Table1[Visitor_ID] ),
            Table1[Time] = NextTime
        )
    )

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

HI @Anonymous

 

Try this calculated Column

 

Sensor to =
VAR NextTime =
    CALCULATE (
        MIN ( Table1[Time] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Date], Table1[Visitor_ID] ),
            Table1[Time] > EARLIER ( Table1[Time] )
        )
    )
RETURN
    CALCULATE (
        FIRSTNONBLANK ( Table1[Sensor], 1 ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Date], Table1[Visitor_ID] ),
            Table1[Time] = NextTime
        )
    )
Anonymous
Not applicable

Thats fantastic! Thanks Zubair really appreciated. The logic makes sense so thankyou. I have marked as correct. Unfortunately I dont have enough memory on my machine to run it!

Hi @Anonymous,

 

I'm glad to hear that you have resolved your issue. Please kindly mark the corresponding reply. It will help others with relevant issue find the answer more easily.

 

Thanks,
Xi Jin.

Anonymous
Not applicable

Thats fantastic! Thanks Zubair really appreciated. The logic makes sense so thankyou. I have marked as correct. Unfortunately I dont have enough memory on my machine to run it!

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.

Top Solution Authors