Forum Discussion

MiKeZZa's avatar
MiKeZZa
Post Patron
9 years ago
Solved

Duplicating some data by adding a table and union them

Hi all,   I want to duplicate/manipulate a imported table. The table has many columns, but to keep it simple lets say 3 columns...   yearmonth   value    origin 201612          10         real d...
  • Phil_Seamark's avatar
    Phil_Seamark
    9 years ago

    Hi MiKeZZa,

     

    How close is this?  Create a calculated table using the following.....

     

    New DAX table = 
    VAR Tb1 = FILTER('Table','Table'[origin]="Real data")
    VAR MaxDate = CALCULATE(MAX('Table'[yearmonth]),'Table'[origin]="Real data")
    VAR Tb2 = SELECTCOLUMNS(
                FILTER('Table','Table'[origin]="Real data" && 'Table'[yearmonth] =MaxDate),
                "yearmonth" , [yearmonth] ,
                "value" , [value],
                "origin" , "forecast")
    Return UNION(Tb1,Tb2)