Forum Discussion
Calulated column question
- 9 years ago
kudos to CS for putting in so much time. I am following this post because I come from the SQL world and it is a classic Unmatch query; and so I'm interested to see how it is implemented in PBI.
In SQL one would have a Parts table (all Parts & Part Type only, no repeats)
Then you would make the 1st unmatched record set which is those sales records where the 2 types do not match.
That would then be made distinct of Part field only so there are no repeats: DistinctUnMatch1
Then you would left outer join Parts to DistinctUnMatch1.
That returns all Parts records but in the UnMatch1 Parts field there are nulls where nothing can match.
This record set is UnMatch2. ... you apply criteria so it only returns the Nulls records- which by definition is the record set that are the Parts with only matched Customer & Part Type.
I may be out of date on PBI capability but I don't think one can define a left outer join - so I presume that is why one is working with yes/no comparisons instead and then a filter.
Wow Anonymous you're really giving this your all, I appreciate the effort.
I think you're giving me the right thing but I need to be able to slice by Yes/No and as it's a measure not a column that's not possible unless I'm missing something in your solution approach.
kudos to CS for putting in so much time. I am following this post because I come from the SQL world and it is a classic Unmatch query; and so I'm interested to see how it is implemented in PBI.
In SQL one would have a Parts table (all Parts & Part Type only, no repeats)
Then you would make the 1st unmatched record set which is those sales records where the 2 types do not match.
That would then be made distinct of Part field only so there are no repeats: DistinctUnMatch1
Then you would left outer join Parts to DistinctUnMatch1.
That returns all Parts records but in the UnMatch1 Parts field there are nulls where nothing can match.
This record set is UnMatch2. ... you apply criteria so it only returns the Nulls records- which by definition is the record set that are the Parts with only matched Customer & Part Type.
I may be out of date on PBI capability but I don't think one can define a left outer join - so I presume that is why one is working with yes/no comparisons instead and then a filter.
- GilbertQ9 years agoSuper UserHi there
You can indeed do a left join or any kind of join in the query editoe. It is called Merge and gives you all the options once you select it. - robofski9 years agoResolver II
CahabaDataIn the end I figured this would be easier to do in a staging table before Power BI and that's what I've ended up doing.
AnonymousThank you for the help, whilst it ultimatley didn't work out, I leart a lot from this thread which I'm sure will come in useful somewhere along my Power BI journey (I'm a relative newbie)