Forum Discussion

Flori_Abb's avatar
Flori_Abb
Helper I
9 years ago
Solved

Union Formula mixes columns

Hello together

 

to improve the download speed from our datawarehouse, i want to split up the data in a historic table (Data from 2013 up to 27th of December) and a current data load table (data from 28th of December onwards). The sql code is the same, only the date changed. Now i wanted to combine these two tables with the union function, but unfortunatly it writes some buying group names from the buying group column in my sales revenue column and converts this column to text instead of number. 

Has someone a quick idea how i can avoid this?

 

Thanks a lot and KR

 

Florian

 

 

  • mim's avatar
    mim
    9 years ago

    just a guess, in your dax union formula, maybe try no to reference the table directly, bu use something like

     

    union (summarize(table_current, field1,field2),summarize(table_history,field1,field2))

26 Replies

  • mim's avatar
    mim
    Advocate V

    first using the union in the data model instead of append PowerQuery is a very clever idea !!  i was think about it when i read about table partition in SSAS

     

    for example 

     

    Powerquery 1 load to table 1 - year 2016 - does not change - load only once 

     

    PowerQuery 2 load table 2 - year 2017 - do change 

     

    then create a calculated table union (table1,table2)

     

    as far as i can see the only reason it is not working, because maybe of a bug 

     

    for example see this 

     

     

    • Flori_Abb's avatar
      Flori_Abb
      Helper I

      Hello together

      thanks a lot for you help and the replies. Unfortunately the problem is not solved, it seems not possible to accelerate the data download by having to identical tables (one with historic) and one with current data. 

      The DAX Union Formula mixes up some columns - guess that`s a bug and i have no clue how to avoid that. The append query solution is also not working as it always loads both table, even with unchecking "enable load" and "include in report refresh". The only result what i get with unchecking "enabling load" is a mess as it delets all relationships and measures.

      So i accept that all as a bug and hope for a solution in the near future. 

       

      BR

      Florian

      • mim's avatar
        mim
        Advocate V

        just a guess, in your dax union formula, maybe try no to reference the table directly, bu use something like

         

        union (summarize(table_current, field1,field2),summarize(table_history,field1,field2))

  • I have the same issue with mixing columns. It looks like a bug. Union works improperly. My story is absolutely the same as of the author of the topic. Name of the column is the same, order - as well. Data sourse is the same too. Queries are duplicated. The only thing that is changed is period. 

    • Flori_Abb's avatar
      Flori_Abb
      Helper I

      Hi Parry

       

      sure, but i guess that`s not really helpful. The column structure is the same in both tables. Also it retrieves the correct data from the Server, only after the union formula it writes at the end the KABEG to the Sales_Rev_Quantity.

       

      KR

       

      Florian

       

      • parry2k's avatar
        parry2k
        Super User

        Let me ask it again. You have two queries in PowerBI from same sql server but filtered on different date and then you are using append query in PowerBI Model, is this correct understanding?