Forum Discussion

gobrien06's avatar
gobrien06
Frequent Visitor
3 years ago

Sum by Month Across Two Data Tables

I have transaction data and want to create a summary by month. However, I am running into problems because the transaction data is located in two different tables. 

 

I need full information on transactions from this Fiscal Year, so I have one table with 70+ columns and nearly 70,000 rows. I also need summary information from previous fiscal years. To reduce the data loaded into the model, I only loaded in 20 columns for the previous two Fiscal Years (each FY also has around 70,000 rows). 

 

What is the most efficient way to combine the data from the two tables to be able to calculate a monthly summary on the transactions? I added a new table with conditional statements to sum on the Transaction Amount table dependent upon the Fiscal Year, but this was a tedious process to simply sum by Fiscal Year. Is there a more efficient way (possibly appending the tables?) to be able to get the data from both tables by month? My only idea so far is to make a measure table with a column for each FY and month, and create a column with multiple conditional statements to match the month and year, and then sum from the appropriate table. However, this seems very inefficient and tedious but have not been able to find another way to successfully combine the data into the monthly summary I need. 

2 Replies

    • gobrien06's avatar
      gobrien06
      Frequent Visitor

      Hello Anonymous, 

       

      I was unable find the way to attach the file. However, I am appending the two queries of tables to solve my issues. 

       

      I am not sure if this is the most efficient solution, but it is working for the current time. Thank you for your assistance.