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

M Code help

Hii,

 

I am new to Power BI, Zero knowlege about M Code in power query editor, my requirement is

 

I have two tables Table 1 contains two measures (Available Capacity) , (Allocated Capacity) with dimmensions year,month, Customer,Organization

Table 2 Contains two measures (BGSW),(OSHC) with Dimensions year, month, Customer , Organization , Prim Skillset ( Extra Dimension in Table 2

Requirement is i want two measure coloums BGSW and OSHC from Table 2 in to Table 1 . please help me in M code

(i.e) I can do this in DAX but i have to do in power Query editor beacuse after getting coloums in to table 1 i need to transpose the table

Please help me in M code or suggest me any M code learing article so i can solve this problem

RamaKrishna_B6_0-1676709316269.png

RamaKrishna_B6_1-1676709393680.png

 

 

1 ACCEPTED SOLUTION

Hi,

you have to group bi your table2 before merging

serpiva64_0-1676799937597.png

I hope i understood your need, on the contrary you have to publish sample data and the desired result (in the images of your data there are not any solution)

 

View solution in original post

10 REPLIES 10

Thanks for the reply im new here how can i post sample data ?

copy and paste

Hii i dont know i posted data 5 times after refreshing the page the post getting deleted

RamaKrishna_B6_0-1676742344215.png

See this is how i posted more than 5 times

Sorry i misunderstood your problem

you have to try to merge tables

serpiva64_0-1676743420298.png

(You have to select the column in the same order)

then expand the columns you want.

Pay attention if the combination of the column you select creates an unique combination (the number of rows in table 1 should be the same after merging)

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

Hey thanks for the reply and I am sorry i couldnt explain you clearly

thanks for your efforts for creating PBIX file and explaining me

see if you look in PBIX file you have shared Table 1 and Table 2 has same rows i mean one to one relation

** But my requirement is For Example in Table 1 Customer has a row  as  A item ok adjacent to A there are Available Capacity and Allocated Capacity right

In Table 2 same Customer A item has two or three BGSW and OSHC because it has has primskillset Coloum 

so i want to get BGSW and OSHC coloums in Table 1 with out consideration of primskillset

Hope i am clear now 

Hi,

you have to group bi your table2 before merging

serpiva64_0-1676799937597.png

I hope i understood your need, on the contrary you have to publish sample data and the desired result (in the images of your data there are not any solution)

 

Hii,

I got it, my requirement got fulfilled thank you so much for your patience even i couldn't explain my requirement clearly..

RamaKrishna_B6_0-1676742606140.png

 

Hi, thanks for the reply

Table 1

YearMonthCustomerOrganizationAllocated CapacityAvailable Capacity
202212PS-DPSX/EAB311
2022122WP-PS-ECMS/EPE-PJ-PE-2WP11
202212AS-ERMS/EVS-SDS-PJ-NXT11
202212PS-BAMS/EHB3-PS11
202212BEG-Non/MCRMS/EXP4-XC11
202212PS-Y/NE-SCMS/ECJ2-PS11
2022120A101SX/ETL411
202212XC-CTMS/EXM4-XC11
202212CMS/EPE-EV-2WP11
202212XC-CTMS/PJ3-ECV-XC11
202212CC-MBMS/ESD-FR1-XC11
202212PS-ECMS/EDI3-XC11
202212XC-DXMS/EEV4-PS11
202212XC-CTMS/EDI-XC11
202212CISX/PMO111

 

Table 2

YearMonthCustomerOrganizationPrimSkillSetBGSWOSHC
202212XC-CTMS/EKI1-XCProgram management11
202212XC-CTMS/ECS-XC-EP3Software Architecture11
202212XC-CTMS/ECP1-XCProject Management11
202212XC-CTMS/ECP1-XCSystem Test Execution11
202212XC-CTMS/ECP4-XCProduct Security11
202212XC-CTMS/EDI1-XCProgram management11
202212XC-CTMS/EKI2-XCAUTOSAR Base Software development11
202212XC-CTMS/ECT2-XCEmbedded Security development and Integration11
202212XC-CTMS/ECO5-XCProject Management Support11
202212XC-CTMS/ESN5-CCProject Management11
202212XC-CTMS/ETW4-2WPEmbedded testing11
202212XC-CTMS/ECP6-XCManagement and Support11
202212XC-CTMS/ECF2-XCEmbedded Application Software Development11
202212XC-CTMS/ECF1-XCDevOps1

1

 

So i want to merge tables such that in Table 1 i want BGSW and OSHC coloums to be added 

Thanks 

serpiva64
Super User
Super User

Hi,

i think that what you are trying to do is not possible.

You have first in power query to create your measures adding columns to your queries then you can try to merge the queries.

Please post some sample data (not images).

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.

Top Solution Authors
Top Kudoed Authors