Forum Discussion

lingvistt's avatar
lingvistt
Frequent Visitor
7 years ago

Creating 1 value from 2 tables for different time periods

Hi community,

 

I have the following task:

-I have 2 datasets mapped with 3 tables (product, customer and date).

-1st dataset contains 'Actual Sales' for 2016-2018

-2nd datasen contains 'Forecast Sales' for 2019

 

I need to create new value, combining actual & forecast sales taking into account connections by product, customer and year. The idea is to see forecast vs actual in one value in different dimensions in terms of product and customer.

2 Replies

  • v-cherch-msft's avatar
    v-cherch-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi lingvistt

     

    It seems you may create a measure as below. If it is not your case, please share some sample data or the file for your scenario so that we could help further on it.

    Measure =
    CALCULATE (
        SUM ( Dataset1[Value] ),
        FILTER ( Dataset1, Dataset1[Year] = 2018 )
    )
        + CALCULATE (
            SUM ( Dataset2[Value] ),
            FILTER ( Dataset2, Dataset2[Year] = 2019 )
        )
    

    Regards,

    Cherie

  • Hi,

     

    It is ideal to append the two datasets.  Once that is done, you can create your desired measure.