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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
        )
    )

Regards
Zubair

Please try my custom visuals

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
        )
    )

Regards
Zubair

Please try my custom visuals
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.