Forum Discussion
Combine Data from Multiple Tables Based on Multiple Dates
- Anonymous1 year ago
Hi Cellblime ,
I create sample datas myself:
And I use this DAX to create the Date Table:Call Date Slicer = CALENDAR(DATE(2024, 11, 1), TODAY())Use these DAXs to create three measures:
Letter Count = COUNTROWS('Letters')Customer Contacts = VAR _Lettercode = MAX('Letters'[Letter Code]) VAR _Customernumber = CALCULATETABLE( VALUES(Letters[Customer Number]), 'Letters'[Letter Code] = _Lettercode ) RETURN CALCULATE( COUNT('Contacts'[Customer Number]), 'Contacts'[Call Date] >= MIN('Call Date Slicer'[Call Date Slicer]) && 'Contacts'[Call Date] <= MAX('Call Date Slicer'[Call Date Slicer]) && 'Contacts'[Customer Number] IN _Customernumber )Contact Rate = [Customer Contacts] / [Letter Count]Use column Letter Date in Table Letters to create letter date slicer:
Use column Call Date Slicer in Table Date to create call date slicer:
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Cellblime ,
I create sample datas myself:
And I use this DAX to create the Date Table:
Call Date Slicer = CALENDAR(DATE(2024, 11, 1), TODAY())
Use these DAXs to create three measures:
Letter Count = COUNTROWS('Letters')Customer Contacts =
VAR _Lettercode = MAX('Letters'[Letter Code])
VAR _Customernumber =
CALCULATETABLE(
VALUES(Letters[Customer Number]),
'Letters'[Letter Code] = _Lettercode
)
RETURN
CALCULATE(
COUNT('Contacts'[Customer Number]),
'Contacts'[Call Date] >= MIN('Call Date Slicer'[Call Date Slicer]) && 'Contacts'[Call Date] <= MAX('Call Date Slicer'[Call Date Slicer]) && 'Contacts'[Customer Number] IN _Customernumber
)Contact Rate = [Customer Contacts] / [Letter Count]
Use column Letter Date in Table Letters to create letter date slicer:
Use column Call Date Slicer in Table Date to create call date slicer:
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Cellblime1 year agoFrequent Visitor
Hello. Thank you for putting in the time to work through this request. I couldn't get too far into your suggestion as my data will always have duplicates so I can't establish relationships (customer calls multiple times, multiple letters sent to same customer, etc.).
- Cellblime1 year agoFrequent Visitor
I bypassed the relationship part and it seems like I was able to get it worked out, or at least it appears that way. I'm going to reconcile the tables against the raw data and see if it worked for sure. I'm grateful and will kudos/accept solution as soon as I verify. Thanks so much!