Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have 2 huge SQL queries on my power bi, both for different table, but the 2nd query partially matches the first query in one column "username" is there a way for me to merge both queries were I just use the column username from the 1st query and filterout all the rows that do no match from the 2nd query? I am not talking about replacing the existin 1st and 2nd query but create a 3rd query based on this
Solved! Go to Solution.
You can do it in two different ways by either merge as a new query and then filter or create a new SQL query with a left or right join where 2ndQuery.username is null. Basically, the merge is Power BI's join, so you tell it it's a left join on the usernames and then you can filter out the 2nd query's usernames to leave only blanks.
If your join column is something else (an order number, for example), then create a new column "Username" that will check if both values are identical. You can use it to filter.
And in SQL, instead of 2ndQuery.username is null, you would then use 1stQuery.username <> 2ndQuery.username
You can do it in two different ways by either merge as a new query and then filter or create a new SQL query with a left or right join where 2ndQuery.username is null. Basically, the merge is Power BI's join, so you tell it it's a left join on the usernames and then you can filter out the 2nd query's usernames to leave only blanks.
If your join column is something else (an order number, for example), then create a new column "Username" that will check if both values are identical. You can use it to filter.
And in SQL, instead of 2ndQuery.username is null, you would then use 1stQuery.username <> 2ndQuery.username
User | Count |
---|---|
73 | |
69 | |
36 | |
25 | |
22 |
User | Count |
---|---|
96 | |
94 | |
53 | |
45 | |
39 |