Forum Discussion

TM_Evan's avatar
TM_Evan
Helper I
9 years ago

Creating a table with multiple values filtered from same table

I have a table where the Loan Number for multiple sources reside on the same table.  The field which differentiates it is the Type Column. 

I already created a column for each loan number (Owner Loan and Product Loan).

Issue I have is that when I attempt to addit to a table they insist on creating seperate rows.  I would like for it to be on one row with a single order number which it applies to.

 

Any suggestions?

Example.

Table A

 

Number                    Type

Order Number            1

12345                          2

3456                            9

9 Replies

  • Desired Result

     

    Order Number                    Owner Loan                    Product Loan

    Order Number                    12345                               3456

    • Anonymous's avatar
      Anonymous
      Not applicable

      Not super sure if this will work in your particular scenario, but the "Pivot Column" button under Edit Queries does exactly what ur asking.

      • TM_Evan's avatar
        TM_Evan
        Helper I

        Thank you Scottsen for replying to this post.  I am still relatively new to Power BI and the suggestion you made is something I have never even considered.  I did try it today with no success unfortunately with error messages stating my data is nested. 

         

        The solution I am going for is more along the lines of DAX expressions.  I am also realizing that I will need to do calculated columns in a table where I only have 1 unique root id.  I unfortunately keep getting errors - ' A table of multiple values was supplied where a single value was expected.'

         

        Funny thing is if I look at the raw data of table B (Where the loan data is, for the one unique root ID we have 3 rows for each of the 3 loan numbers suppled.  My 1 column is only providing the logic to return 1 of them.

         

        Here is the DAX statement used.

        OwnerLoan = CALCULATE(VALUES('pfm B'[Number]),Filter('B','B'[Type] = 2 && 'A'[RootId#] = 'B'[RootId#]))