Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hey all...hopefully an easy one for all of you smart people here!
A quick illistrative example is below, with an explanation below that. Note that the Unique ID is simply used to tie answers together, so no extra thought needed for this piece:
I'm trying to combine two tables, where the two columns in table one will apphend to the end of one of the columns of table two to form a new third table. Then I need the column header for those values in table one to fill the rows adjacent. I've managed to get really close, but I can't figure out how to pass a value as anything other than a blank. Here's what I have:
Combo =
VAR tableone =
SELECTCOLUMNS ( UniqueID, "ID", [UniqueID], "Answer", [Answer ABC], "Question", BLANK() )
VAR tableoneagain =
SELECTCOLUMNS ( UniqueID, "ID", [UniqueID], "Answer", [Answer #], "Question", BLANK() )
VAR tabletwo =
SELECTCOLUMNS ( UniqueID, "ID", [UniqueID], "Answer", [Answer], "Question", [Question] )
RETURN
UNION ( tableone, tableoneagain, tabletwo )
Basically I need the "Blank ()" to instead be "Answer ABC" for the first SELECTCOLUMNS and "Answer #" for the second. Right now with the code above, I'm getting this:
Thanks!!!
Solved! Go to Solution.
Hi @SEDE ,
You can try to unpivot columns and then append the query in the Power Query Editor, like this:
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@SEDE , based on what I got, You can add a blank in place Answer ABC, just need to make sure that is not the first table
Combo =
VAR tableone =
SELECTCOLUMNS ( UniqueID, "ID", [UniqueID], "Answer", blank(), "Question", BLANK() )
VAR tableoneagain =
SELECTCOLUMNS ( UniqueID, "ID", [UniqueID], "Answer", [Answer #], "Question", BLANK() )
VAR tabletwo =
SELECTCOLUMNS ( UniqueID, "ID", [UniqueID], "Answer", [Answer], "Question", [Question] )
RETURN
UNION ( tabletwo,tableoneagain,tableone )
Hey amitchandak! I appreciate the attempt. I'm actually trying to get rid of all the blanks, and replace them with the column header from each particular column. This is what I'm hoping to achieve:
Thanks!
Hi @SEDE ,
You can try to unpivot columns and then append the query in the Power Query Editor, like this:
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
After finagling some table names and stuff, this works great! Thank you so much!
-SEDE
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
218 | |
88 | |
83 | |
65 | |
56 |