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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
berkero
New Member

DAX Lookupvalue help please

Hello everyone ,

 

I need a help about a lookupvalue dax formula for the same table. I have the columns like the example and need to write the "Previous Visit End Time" whit dax formula.

 

May i ask your help please. Thank you in adavnce

 

berkero_0-1711101904759.png

 

2 ACCEPTED SOLUTIONS
Daniel29195
Super User
Super User

@berkero 
try the following 

create a calculate column as follow.: 

col = 

Var ds =

offset ( -1, 

summarize ( 

tbl_name, 

tbl_name[representative id], 
tbl_name[visit date] , 

tbl_name[visit queue], 

tb_name[visitend time]
) , 

orderby(tbl_name[visit_queue] , asc ) , 

partitionby(tbl_name[representative id] , tbl_name[visit date] )

)

 

return 

selectcolumns(

ds, 

"res" , tbl_name[visitend time] ) 

 

 

let me know if this works for you . 

 

if this helped you solving your problem, 

make sure to give it a thumbs up and accept it as a solution so others can find it quickly. 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = CALCULATE(MAX(Data[Visit End Time]),FILTER(Data,Data[Representative ID]=EARLIER(Data[Representative ID])&&Data[Visit Date]=EARLIER(Data[Visit Date])&&Data[Visit End Time]<EARLIER(Data[Visit End Time])))

Hope this helps.

Ashish_Mathur_0-1711170606435.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = CALCULATE(MAX(Data[Visit End Time]),FILTER(Data,Data[Representative ID]=EARLIER(Data[Representative ID])&&Data[Visit Date]=EARLIER(Data[Visit Date])&&Data[Visit End Time]<EARLIER(Data[Visit End Time])))

Hope this helps.

Ashish_Mathur_0-1711170606435.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

thank you so much.. it works..

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Daniel29195
Super User
Super User

@berkero 
try the following 

create a calculate column as follow.: 

col = 

Var ds =

offset ( -1, 

summarize ( 

tbl_name, 

tbl_name[representative id], 
tbl_name[visit date] , 

tbl_name[visit queue], 

tb_name[visitend time]
) , 

orderby(tbl_name[visit_queue] , asc ) , 

partitionby(tbl_name[representative id] , tbl_name[visit date] )

)

 

return 

selectcolumns(

ds, 

"res" , tbl_name[visitend time] ) 

 

 

let me know if this works for you . 

 

if this helped you solving your problem, 

make sure to give it a thumbs up and accept it as a solution so others can find it quickly. 

It works.. thank you so much

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.