Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all
I need to add a column from one table to another using merge queries in Power query, in order to go from this is in table called "lines"
to this:
As seen, each of the 3 products or row, were assigned all the available months. So, column F "month" highlighted in light blue is the result desired.
When I merge the queries by common field country:
I am getting months duplicated or more by each of the 3 products, which is incorrect:
How can I get it right?
The result desired is in the excel attached.
https://1drv.ms/u/s!ApgeWwGTKtFdhn1PztJLnkIbOkgM?e=ucmaxr
Thanks!
Solved! Go to Solution.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@o59393 Good afternoon, I ask you a question. I have the same problem where "for a certain critero (reason for high / low of employees of the month) brings me the values that coincide with such a person of my payroll of employees"; thus doubling the values for certain employees. In your case how did you solve it? I'm not sure what answers you were given.
Thanks in advance
Hi @o59393
@AllisonKennedy is right. Unlike the vlookup in Excel which will return the first matching row, the Merge Query in Power BI behaves similar to SQL - you'll get all rows for every match.
Hi @AllisonKennedy and @AllisonKennedy
It was an error on my end that was duplicating the months.
Thanks for the help!
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
User | Count |
---|---|
84 | |
79 | |
70 | |
47 | |
41 |
User | Count |
---|---|
108 | |
52 | |
50 | |
40 | |
40 |