Forum Discussion

NManku's avatar
NManku
Regular Visitor
8 years ago
Solved

Comparing monthly aggregated data from one table to monthly targets in another table

Hi there,   I'm relatively new to Power BI but learning!   I have two sets of data which I want to link together, but I'm struggling to get to exactly what I want. In one table I have donation a...
  • DAX0110's avatar
    8 years ago

    Hi NManku, this is a typical many-to-1 scenario.  You would begin (in Data View) by adding a calculated column to Table 1 that transforms the donation date-month-year into month-year, which is the same format and data type as Table 2's "month" column.

     

    For example, if Table 2's "month" column is a "text" type, then the calculated column should be text as well.  However, if it's a date type that uses 1-Apr-2017 to represent the whole month, then the calculated column should map DD-Apr-2017 to 1-Apr-2017.

     

    Next, in the Relationship View, link this calculated column to the "month" column in Table 2.

     

    Then, you'd add three measures :

    Actual Donation Total := SUM( 'Table 1'[Donation Amount] )

    Target Domation Total := AVERAGE('Table 2'[Target] )

    Difference := [Actual Donation Total] - [Target Donation Total]

     

    Finally, go to Report View, add a Table visual,  and put "Month" from Table 2 on the rows, and the three measures on the Values.