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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sut_Datanaut
Helper II
Helper II

connect tables by customer ID and date

Hey all, 

 

Hoping to get some help on a problem I am having. I have 4 tables, with 3/4 having customer ID, date and some form of value (revenue, phone calls etc..) each one of these three tables also have a category that extrapolates the value (so the revenue will have application, phone calls with have location etc..)

 

The other table is a survey table that I am trying to use as the central table which pulls all of the other information from the other tables. The problem is that the survey table has customer ID, response and survey score, but:

 

1. 1 customer can have multiple survey's and survey dates

2. there does not need to be a customer ID related to a survey, but i would still like to include these in the overall number

 

I tried to combine account number and date to one column and m2m connect the 3 tables to the 1 survey table,  but since the date on the survey table is only relayed to their survey date, values only connected in the date in which they had a survey, and not by the full account. 

 

Desired output is below

 

Example of 3/4 tables (all follow same extrapolation)

Customer IDDateApplication Revenue 
11/1/2023eBay $            232
11/1/2023Amazon $         5,453
12/1/2023eBay $            546
12/1/2023Amazon $         7,657
13/1/2023eBay $            353
13/1/2023Amazon $       32,423
14/1/2023Amazon $       32,666
15/1/2023eBay $            232
16/1/2023eBay

 $         5,467

 

 

Example of the Survey Table 

Customer IDSurvey Month DateSurvey ScoreSurvey Comment
11/1/20234.00I like this
12/1/20232.00its ok
14/1/20231.00its bad
21/1/20234.00it great
33/1/20232.00its ok
(blank)2/1/20234.00I like this app

 

 

Desired output

 

Customer IDMonth DateApplication Revenue  Survey Date Survey ScoreSurvey Comment
11/1/2023eBay $            2321/1/20234.00I like this
11/1/2023Amazon $         5,453   
12/1/2023eBay $            5462/1/20232.00its ok
12/1/2023Amazon $         7,657   
13/1/2023eBay $            353   
13/1/2023Amazon $       32,423   
14/1/2023Amazon $       32,6664/1/20231.00its bad
15/1/2023eBay $            232   
16/1/2023eBay $         5,467   

 

The problem I am ultimatley running into is that I need this kind of view across all 3 value based fact tables WITH their corresponding category without duplicating the values. 

 

Any help is appreciated. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Sut_Datanaut,

I check the sample data and not found any field can be used to accurate mapping the comment and score from survey table to correspond applications.
Did you mean these survey data show display on all related rows that recorded with the same customer and date values?

If that's the case, you can create two calcuated columns to the first table with lookupvalue function to get values based on current customer id and date values.

Score =
LOOKUPVALUE (
    Survey[Score],
    '3/4'[Customer ID], Survey[Customer ID],
    '3/4'[Date], Survey[Date],
    BLANK ()
)

Comment =
LOOKUPVALUE (
    Survey[Comment],
    '3/4'[Customer ID], Survey[Customer ID],
    '3/4'[Date], Survey[Date],
    BLANK ()
)

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @Sut_Datanaut,

I check the sample data and not found any field can be used to accurate mapping the comment and score from survey table to correspond applications.
Did you mean these survey data show display on all related rows that recorded with the same customer and date values?

If that's the case, you can create two calcuated columns to the first table with lookupvalue function to get values based on current customer id and date values.

Score =
LOOKUPVALUE (
    Survey[Score],
    '3/4'[Customer ID], Survey[Customer ID],
    '3/4'[Date], Survey[Date],
    BLANK ()
)

Comment =
LOOKUPVALUE (
    Survey[Comment],
    '3/4'[Customer ID], Survey[Customer ID],
    '3/4'[Date], Survey[Date],
    BLANK ()
)

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Regards,

Xiaoxin Sheng

How does this compare to using userelationship within a calculated measure? I see the logic looks somewhat similar. Also can you explain the use of 3/4?

 

Thanks!!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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