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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors