Forum Discussion

avou26's avatar
avou26
Frequent Visitor
1 year ago
Solved

Using the sum from two different reports in bar chart

Hello,   I have two different data sources that each have a list of payments and their corresponding dates( lets call them lake payments and park payments). I would like to have a bar chart that sh...
  • Kedar_Pande's avatar
    1 year ago

    avou26 

    Yes, you can fix this issue by ensuring that both data sources (Lake Payments and Park Payments) are correctly linked to your calendar table.

     

    Link the Date field in the Calendar table to the Date field in both the Lake Payments and Park Payments tables. Ensure both relationships are inactive so you can control them with DAX.

     

    Measure 1:

    LakePaymentsSum =
    CALCULATE(
    SUM('Lake Payments'[PaymentAmount]),
    USERELATIONSHIP('Calendar'[Date], 'Lake Payments'[Date])
    )


    Measure 2:

    ParkPaymentsSum =
    CALCULATE(
    SUM('Park Payments'[PaymentAmount]),
    USERELATIONSHIP('Calendar'[Date], 'Park Payments'[Date])
    )

     

    • Use the Year field from the Calendar table for the axis.
    • Use the two new measures (LakePaymentsSum and ParkPaymentsSum) for the values.

    If this helped, a Kudos 👍 or Solution mark would be great!

    Cheers,

    Kedar Pande

    www.linkedin.com/in/kedar-pande