Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Combining data

Hi all,   I have the following 2 tables :   ACTUALS   period actuals 01.01.2022 10 01.02.2022 5 01.03.2022 6 01.04.2022 7 01.05.2022 8 01.06.2022 9 01.07.2022 ...
  • speedramps's avatar
    4 years ago

    Hi YBZ

     

    Create a calendar table with a list of all periods.

     

    Create a 1:M relation from  Calendar[period] to ACTUALS[period]

    Create a 1:M relation from  Calendar[period] to LE[period]
    Create a 1:M relation from  Calendar[period] to YTD[period]

     

    Create this dax measure

     

    Your answer = 

    IF(ISEMPTY[YTD]),
    SUM(LE[actual]),
    SUM(ACTUALS[actual])
    )

    Draw a table visuals with

    Calendar[period]

    LE[actual]

    ACTUALS[actual]

    and [Your answer]

     

    I hope that the dax measure is self explanationary.

    The YTD table may have lots of rows but 

    if the YTD table has no corresponsdnig rows for the calendar period then it is 'empty' in that context.

    This is much quicker than counting records and then doing if record Count = 0 logic.

     

    Please click thumbs up and accept as solution. 😀