How to merge two tables in powerpivot excel 2013?

Hi 
I have a few tables imported from two different systems/databases/tables and I need to merge them into one table in Power Pivot.
All of the import tables have some common fields such as Name, Value. e.g. Staff Expenses, Staff Sales table
The output table at lest with 3 columns (Name, Value, and Data Source). The Data Source column indicates which table the row value comes from.  
How can I merge the tables using DAX?
Regards
Joe Lee
update: Just add a few sample data and chart I was required to develop
Name
Expense
Joe
1000
James
2000
Name
Sales
Joe
3000
James
10000
The chart I need to develop
I was thinking using DAX to merge the table as follow for the chart
Name
DataSource
Value
Joe
Expense
1000
James
Expense
2000
Joe
Sales
3000
James
Sales
10000
jl

Hi Joe,
DAX doesn't currently have a UNION function so you'll need to use a workaround such as
this to achieve the result but it won't be suitable for all scenarios. I would generally recommend using the Append capability
in Power Query for this type of task as it would be a much better fit. However, I should highlight that using Power Query would limit your refresh options to a manual refresh from within the workbook or scheduled refreshes using Power BI
for Office 365. If this is not a deal breaker then Power Query is the way to go.
Regards,
Michael Amadi
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
Website: http://www.nimblelearn.com, Twitter:
@nimblelearn

Similar Messages

  • How to CREATE VIEW to merge two tables each of which has CLOB-typed column

    I failed in creating a view to merge two tables that have CLOB-type column each.
    The details are:
    Database: Oracle 9i (9.2.0)
    Two tables "test" and "test_bak", each of which has the following structure:
    ID Number(10, 0)
    DUMMY VARCHAR2(20)
    DUMMYCLOB CLOB
    The following operation fails:
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test
    union
    select id, dummy, dummyclob from test_bak;
    I was announced:
    select test.id, test.dummy, test.dummyclob
    ERROR in line 2:
    ORA-00932: inconsistent data type: required - , but CLOB presented.
    But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
    1) one table, with CLOB-typed column
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test;
    2) two tables, without CLOB-typed columns
    create view dummyview (id, dummy) as
    select id, dummy from test
    union
    select id, dummy from test_bak;
    I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
    many thanks in advance

    Dong Wenyu,
    No.
    But you could do this:
    SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
    FROM your_table1 tab1, your_table2 tab2, (
    SELECT primary_key, ...
    FROM your_table1
    UNION
    SELECT primary_key, ...
    FROM your_table2
    ) source
    WHERE source.primary_key = tab1.id (+)
    AND source.primary_key = tab2.id (+)
    In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
    d.

  • How to merge two repositories using(MUD)

    hi all,
    how to merge two repositories using mude, for example i have sh rpd and paint rpd how to merge two repositories using Multi user development(mud), please don't give venkat forums link and oracle's training doc links.
    Is this possible? if it is possible please help me .
    Thanks
    Naresh

    Hi Naresh,
    What you could do is:
    1. do a ontime command line merge of both repository using the nqudmlexec tool
    2. In the mergerd repository created two project (sh and paint) and assign one bussiness model to each project.
    3. Make this the master repository for your MUD.
    4. Check the projects in and out.
    regards
    John
    http://obiee101.blogspot.com

  • How to merge two search button from different criteria

    How to merge two search button from different criteria
    this image show the question
    http://s24.postimg.org/4algthuj9/1111.jpg
    two different criteria for the same view and I need to merge it in one button as when I click
    on the button search result give from two criteria parameters

    You can!t using af:query. the af:query component comes as is. If you can't do it through the properties, you probably can't do it at all.
    As in your other thread, the way to go is to program your own search form. This way you can use a layout and functionality you like.
    For this you create a form with input fields for the values you are searching for, put them on hte page in a way you like and in the end by hitting on a button (e.g. called Search) map all inputfields to parameters of a service method you defined in your application module or VO. This service method then executes a view criteria returning all matches in the default iterator (just as if you had used af:query.
    Timo 

  • How to update two tables with trigger

    Hi:
    how to update two tables with trigger ?
    I have two tables :
    (1)ASIA
    MI number;
    (2)ASIA_P
    ID number;
    When I insert a new value into the asia.MI ,I also can
    insert the same value into the asia_p.id field.
    I have write a trigger as follows but it does't work.
    create or replace trigger MI_TRG
    before insert on asia
    for each row
    declare
    seq number;
    begin
    select MI_SEQ.Nextval into seq from dual;
    :new.MI:=seq;
    insert into ASIA_PRO(MI_ID)
    values
    (seq);
    end MI_TRG;
    How to realize it ?
    thanks
    zzm

    Why do you say it does not work?

  • How to join two tables

    hi
    how to join two tables using inner join  if the first table has two primary keys and second table has 3 primary keys

    Would describe type of joins in ABAP, which might differ with other joins.
    The join syntax represents a recursively nestable join expression. A join expression consists of a left-hand and a right- hand side, which are joined either by means of INNER JOIN or LEFT OUTER JOIN. Depending on the type of join, a join expression can be either an inner (INNER) or an outer (LEFT OUTER) join. Every join expression can be enclosed in round brackets. If a join expression is used, the SELECT command circumvents SAP buffering.
    On the left-hand side, either a single database table, a view dbtab_left, or a join expression join can be specified. On the right-hand side, a single database table or a view dbtab_right as well as join conditions join_cond can be specified after ON. In this way, a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM.
    AS can be used to specify an alternative table name tabalias for each of the specified database table names or for every view. A database table or a view can occur multiple times within a join expression and, in this case, have various alternative names.
    The syntax of the join conditions join_cond is the same as that of the sql_cond conditions after the addition WHERE, with the following differences:
    At least one comparison must be specified after ON.
    Individual comparisons may be joined using AND only.
    All comparisons must contain a column in the database table or the view dbtab_right on the right-hand side as an operand.
    The following additions not be used: NOT, LIKE, IN.
    No sub-queries may be used.
    For outer joins, only equality comparisons (=, EQ) are possible.
    If an outer join occurs after FROM, the join condition of every join expression must contain at least one comparison between columns on the left-hand and the right-hand side.
    In outer joins, all comparisons that contain columns as operands in the database table or the view dbtab_right on the right-hand side must be specified in the corresponding join condition. In the WHERE condition of the same SELECT command, these columns are not allowed as operands.
    Resulting set for inner join
    The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the right-hand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set.
    Resulting set for outer join
    The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the right-hand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values.
    Note
    If the same column name occurs in several database tables in a join expression, they have to be identified in all remaining additions of the SELECT statement by using the column selector ~.
    Example
    Join the columns carrname, connid, fldate of the database tables scarr, spfli and sflight by means of two inner joins. A list is created of the flights from p_cityfr to p_cityto. Alternative names are used for every table.
    PARAMETERS: p_cityfr TYPE spfli-cityfrom,
    p_cityto TYPE spfli-cityto.
    DATA: BEGIN OF wa,
    fldate TYPE sflight-fldate,
    carrname TYPE scarr-carrname,
    connid TYPE spfli-connid,
    END OF wa.
    DATA itab LIKE SORTED TABLE OF wa
    WITH UNIQUE KEY fldate carrname connid.
    SELECT ccarrname pconnid f~fldate
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM ( ( scarr AS c
    INNER JOIN spfli AS p ON pcarrid = ccarrid
    AND p~cityfrom = p_cityfr
    AND p~cityto = p_cityto )
    INNER JOIN sflight AS f ON fcarrid = pcarrid
    AND fconnid = pconnid ).
    LOOP AT itab INTO wa.
    WRITE: / wa-fldate, wa-carrname, wa-connid.
    ENDLOOP.
    Example
    Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr.
    PARAMETERS p_cityfr TYPE spfli-cityfrom.
    DATA: BEGIN OF wa,
    carrid TYPE scarr-carrid,
    carrname TYPE scarr-carrname,
    connid TYPE spfli-connid,
    END OF wa,
    itab LIKE SORTED TABLE OF wa
    WITH NON-UNIQUE KEY carrid.
    SELECT scarrid scarrname p~connid
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM scarr AS s
    LEFT OUTER JOIN spfli AS p ON scarrid = pcarrid
    AND p~cityfrom = p_cityfr.
    LOOP AT itab INTO wa.
    IF wa-connid = '0000'.
    WRITE: / wa-carrid, wa-carrname.
    ENDIF.
    ENDLOOP.

  • How to comapare two tables data difference

    Hi all,
    Can any one tell me how to compare two tables data of two different data bases .
    Table names are same in both databases.
    Thanks You
    Regards,
    P Prakash

    833560 wrote:
    I don't have privilege to create data base link ,If the database has no link so that you can query the the data, you have two options.
    Find someone with the privilege to create the link and write a query like this
    Re: Efficient way to comapre two tables.
    Which as I mention may not be quick,
    Kindly tell me some other way .But will be quicker than your other option which is to dump the data into two spreadsheets and start reading.

  • How to merge two XML's with JDOM?

    How to merge two xmls's using jdom? like:
    is there a way to add the complete content one xml into the parent node of another xml?
    //in.xml
    <?xml version="1.0"?>
    <people>
    <person>
      <name>ABC</name>
      <email>[email protected]</email>
    </person>
    </people>
    //out.xml
    <?xml version="1.0"?>
    <address>
    <city> abccounty</city>
    <state> abcstate</state>
    </address>
    Merged XML:
    <?xml version="1.0"?>
    <people>
    <person>
      <name>xyz</name>
      <email>[email protected]</email>
    </person>
    <address>
    <city> abccounty</city>
    <state> abcstate</state>
    </address>
    </people>
    import java.util.List;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    import org.jdom.output.Format;
    import org.jdom.output.XMLOutputter;
    public class MergeXMLS {
         public static void main(String[] args) {
              try{
                  SAXBuilder builder = new SAXBuilder();
                  Document books = builder.build("D:/in.xml");
                  Document onebook = builder.build("D:/out.xml");
                  Element root = books.getRootElement();
                  List rows = root.getChildren();
                  for (int i = 0; i < rows.size(); i++) {
                      Element row = (Element) rows.get(i);
                      onebook.getRootElement().addContent(row.detach());
                      System.out.println(row.getName());
                  new XMLOutputter(Format.getPrettyFormat()).output(onebook, System.out);
              }catch(Exception e){
                   e.printStackTrace();
    }

    The above code only add's the first node.
    I changed the code little differently to
                  SAXBuilder builder = new SAXBuilder();
                  Document books = builder.build("D:/in.xml");
                  Document onebook = builder.build("D:/out.xml");
                 //trying to add second xml into the first
                  books.getRootElement().addContent(onebook.getRootElement().getContent()); 
                  new XMLOutputter(Format.getPrettyFormat()).output(books, System.out);
    here is the exception from the above code:
    org.jdom.IllegalAddException: The Content already has an existing parent "address"
         at org.jdom.ContentList.add(ContentList.java:218)
         at org.jdom.ContentList.add(ContentList.java:140)

  • [Help] How to merge two rows in a datagrid?

    How to merge two rows of a specific column in a datagrid?
    ex.
    |_______|_____|_____|
    | merged |_____|_____|
    |_______|_____|_____|
    |_______|_____|_____|
    thx a lot~

    I need to merge column heading. Have u find any solution for
    ur problem?

  • How to merge two cells in a row

    hi freinds,
    how to merge two cells in alv grid using oops.
    for eg ,in the first row there is text premraj
             n in the second row there is cheguri
              my requriment is two merge the two cells ie to remove the horizontal line between them
    thanks & regards,
    premraj

    Well, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.

  • How to merge two accounts?

    How to merge two accounts apple id and icloud (purchase)?

    You can't. See: http://support.apple.com/kb/HT4895

  • How to merge two adjacent partitions?

    How to merge two adjacent partitions?

    The formal steps are delete the second partition and right click on first one, choose "extend".
    Of course this will erase data on second partition.
    Some third party tools can help do the job with keep data on second partition. 
    If you have any feedback on our support, please send to [email protected]

  • How to merge two Outlook 2010 pst data files?

    How to merge two Outlook 2010 pst data files?

    Easy way: with the one you want to use open in Outlook and the other one not in your profile, go to File, Open, Import.
    If you only want to merge some content, open both pst files in outlook and drag between folders. For calendar, use a list view to see all of the appointments.
    Diane Poremsky [MVP - Outlook]
    Outlook Daily Tips |
    Outlook & Exchange Solutions Center
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • How to merge two conflicting contact on iPhone and on laptop?

    How to merge two conflicting contacts?
    When syncing my iPhone w/ my Mac laptop, it seems that Apple does not provide an option that allows you to merge the data from two conflicting contacts.  For example, you have a contact on your iPhone for Andy Summer and a contact on your laptop for Andy Summers - one contact contains only Andy's name and email address, the other contact contains only Andy's name and his mailing address.  I'd like to be able to merge the data from these two contacts into one and save it to both, but the Conflict Resolver in the syncing program (I think it's in iTunes) does not offer an option for merging the two.
    Does anyone have any knowledge about 1) how to merge data from two conflicting contacts, or 2) some other way to keep the data from each so that I don't have to choose one over the other?

    Jawad,
    First of all,You need to make teaming on both the interfaces on the server side.Which mode do you want to use? Active-Active or Active-Standby.
    Server side :Active-Active - You need to configure the switch side to be a etherchannel/LACP. It can be done by the commands on the cisco 4006.
    Server side :Active-Standby - You need nothing to do at the switch side.
    Note: Seems PAGP is a proprietary of cisco. Server shouldn't know that. To be bound with mode "on" of "lacp" should be fine. It depends on the server side as well.
    HTH
    Thot

  • How to merge two movies documents into 1 in  iTunes?

    Can anyone tell me how to merge two movies documents into one in iTunes? Sorry maybe this is an easy and dumb question for you, but I have totally no idea. I download some movies in Windows and use Kigo Video Coverter to converte them into mp4 format. So I can watch it through new Apple TV in my big screen TV. Now I am thinking maybe I can upgrade my experience a bit more. Because some movies are downloaded into 2 or 3 separated document and I have to choose and click them while seeing. Is there any software can merge those separated documents into one single in mp4 format? I wish you could give me several to choose . Freeware is better. Thanks in advance.

    Thanks. I've tried simplemovies application but it seems too much complicated for me. I read some passages online and bought Quicktime Pro ($30) and finally link 2 mp4 documents together. So easy. Only issue is I have to pay $ 30 .

Maybe you are looking for

  • Query Variable

    Hi friends, I have a query, i need to make 0Region as a selection option for which i have to create a variable. I have created a variable but my problem is it is taking only single value, how can i change that to hold multiple values. Cany anybody he

  • HT4623 in the process of updating to ioS6, how do i respond when the screen says choose a network?

    in the process of updating iphone5 to ioS6, how do I respond when the screen says choose a network?

  • Forms 9i $$$Edition

    Our current product is written in Forms/Reports 6i and runs in Client server mode and we are looking to move forward. The current situation is that our customers buy a database license and the application is a free runtime license of forms, a model s

  • IPhone6 won't connect to Bluetooth

    My iPhone six will not connect to my Bluetooth since I OS 8.3 update. Have turned Bluetooth off, rebooted device, turn Bluetooth back on. It keeps searching but cannot fi have turned Bluetooth off, rebooted device, turn Bluetooth back on. It keeps se

  • Removing print drivers from Leopard

    is it a)advisable and b)easy to remove unwanted printe drivers from Leopard's Library folder?