Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mittulburad
New Member

Columns data to Rows

Hello,

 

I am new to Power BI. Below are three data tables.

 

Table 1 - VchHdr

VoucherIDDateVoucherTypeNameVoucherNoDestinationGodown
45101-04-2020 00:00Cutting1JKBM Godown

 

Table 2 - InvLine

VoucherIDAccLineNoInvLineNoStockItemNameIsDeemedPositiveIsAutoNegateRateAmountActualQuantityActualUOM
45101Club Deluxe - Cut TasTRUEFALSE12.16-1203849900Pcs
45102Seconds Cutting TasTRUEFALSE7-35050Pcs
45103Wastage Cutting TasTRUEFALSE0025Pcs
45104Seconds Dori Cutting TasTRUEFALSE7-17525Pcs
45105Club Deluxe- WIPFALSEFALSE10.1610160010000Nos

 

Table 3 - BatchLine

VoucherIdAccLineNoInvLineNoBatchLineNoMfdOnGodownNameBatchNameDestinationGodownNameActualUOM
45101101-01-1900 00:00JKBM GodownPrimary BatchJKBM GodownPcs
45102101-01-1900 00:00JKBM GodownPrimary BatchJKBM GodownPcs
45103101-01-1900 00:00JKBM GodownPrimary BatchJKBM GodownPcs
45104101-01-1900 00:00JKBM GodownPrimary BatchJKBM GodownPcs
45105116-03-2020 00:00JKBM GodownJ1451JKBM GodownNos

 

Below is the final result table i need:

DateStockItemNameInvLineNo 1InvLineNo 2InvLineNo 3InvLineNo 4TotalLot No.
01-04-2020 00:00Club Deluxe- WIP990050252510000J1451

 

Note: 1) StockItemName where the Column "IsDeemedPositive" yes in InvLine Table

2) Lot no. will be from Table BatchLine where ActualUOM is Nos

 

 

Thanks

 

 

3 REPLIES 3
Bizualisation
Resolver I
Resolver I

You can use the merge function in the query editor (Home > Transform Data) to merge these tables.

 

You can also apply filters ( "IsDeemedPositive" yes in InvLine Table)

 

Although Looking at your data it is a little unclear how exactly you want to aggregate these rows. You'll need to pick a column to merge on for each join. If you post an example PBIX I can take a look.

Hello, Let assume there is only one table (Table 2 - InvLine)

 

I want the below final output:-

 

    
VoucherIDStockItemName1234Total
451Club Deluxe - WIP990050252510000

 

When "IsDeemedPositive" FALSE - it will appear in in Column "StockItemName" 

and the Actual Qty of the other rows with same VoucherID will appear in the values field against that StockItemName.

 

Hope this will help.

OK cool - if you go back to your example with multiple tables, heres what you can do to achieve that effect:

 

If you want to maintain your first table, duplicate it and apply this step to the duplicate otherwise just filter the table to only show rows where the "IsDeemedPositive" is FALSE. Now you have a table with only the items you are interested in.

 

Then merge the second table (your table with Batchname in) into the first one, joining on the voucher ID. Once you do this you'll get a column appear at the end of the first table, with each value being the word Table in yellow. Click the two arrows at the top of the column and you should see two options, expand or aggregate. If you click aggregate you'll see the options to aggregate the second table into the first - then you can count items, or sum quantity, whatever you need to do.

 

Hope that helps!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.