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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Sajeerahammed
Regular Visitor

V lookup in dax(Multiple ciriteria)

Dear All,

Im new to dax and I need Help on below topic.I need to bring customer name from first table to second table(Desired output)according to time and Salesman(Two cirterias).In first table time mentioned in time period and in second table its precise.

 

Table 1
CustomerSalesman NameStart TimeEnd Time
Carrefour City CentreSuraj04-11-2023, 08:38:25 AM04-11-2023, 08:38:41 AM
Carrefour City CentreSuraj04-11-2023, 08:38:41 AM04-11-2023, 08:42:38 AM
Carrefour City CentreSuraj04-11-2023, 08:42:38 AM04-11-2023, 08:42:48 AM
Carrefour City CentreSuraj04-11-2023, 08:42:48 AM04-11-2023, 09:18:20 AM
MONOPRIX SHOPSuraj04-11-2023, 09:18:20 AM04-11-2023, 09:18:33 AM
MONOPRIX SHOPSuraj04-11-2023, 09:18:33 AM04-11-2023, 09:34:57 AM
carrefour,landmarkRaja04-11-2023, 09:34:57 AM04-11-2023, 10:43:29 AM
carrefour,landmarkRaja04-11-2023, 10:43:29 AM04-11-2023, 10:43:40 AM
carrefour,landmarkRaja04-11-2023, 10:43:40 AM04-11-2023, 10:44:21 AM

 

 

Table 2
TimeSalesmanDesired output
04-11-2023, 08:50:07 AMSurajCarrefour City Centre
04-11-2023, 09:36:30 AMRajacarrefour,landmark
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

Hi @Sajeerahammed ,

 

try to add a calculated column in table2 like:

Column = 
MAXX(
    FILTER(
        table1,
        Table1[Salesman Name]=Table2[Salesman]
            &&Table1[Start Time]<=Table2[Time]
            &&Table1[End Time]>=Table2[Time]
    ),
    Table1[Customer]
)

 

it worked like:

FreemanZ_0-1701595057174.png

 

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

Hi @Sajeerahammed ,

 

try to add a calculated column in table2 like:

Column = 
MAXX(
    FILTER(
        table1,
        Table1[Salesman Name]=Table2[Salesman]
            &&Table1[Start Time]<=Table2[Time]
            &&Table1[End Time]>=Table2[Time]
    ),
    Table1[Customer]
)

 

it worked like:

FreemanZ_0-1701595057174.png

 

thank you sir...Problem solved

kaisrec
Advocate I
Advocate I
Tom_Y
Advocate II
Advocate II

The question is why do you need a Table 2? All the information seems ready in Table 1 for presentation. You just need to categorize them in visual?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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