Forum Discussion

Cellblime's avatar
Cellblime
Frequent Visitor
1 year ago
Solved

Combine Data from Multiple Tables Based on Multiple Dates

***Still Learning Power BI*** I have multiple tables, with 3 or 4 of them being involved in this question. Below is the table breakdown (I can’t provide raw data as I’m using a government system.). ...
  • Anonymous's avatar
    Anonymous
    1 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.