Forum Discussion
Filter 2 Columns In A Table Into A Single Column With True/False
Greetings All -
I've recently inherited a PowerBI desktop report where I need to make some changes. From a high level, I need to compare two columns in a single table and return a value of 'True' if the values match. If not, then the value would be 'False' - the trues and falses could be 1's and 0's, or yes's and no's if that works better. However, both columns contain blanks (or nulls) and I only want to perform the comparison on the two columns where the cells have numerical values in them. I need this to happen on a row by row basis. The previous owner created a conditional column to perform the comparison, but didn't filter out the blanks in each column thus creating false "True's" so to speak. The M code and screenshot are below:
In PowerQuery, this is what it looks like:
What I'd like to do is turn the conditional column "Matching Primary and Billed" into a calculated column using a single DAX expression that compares the values in EMPLOYEE_ID and E_PRIMARY_EMPLOYEE_ID and return a True if they match, a FALSE if they don't and only for the values in both columns that have a numerical value in them (ignoring the nulls/blanks). I'm guessing some combination of IF(ISBLANK and/or FILTER functions may be involved but I'm uncertain of the correct syntax in this case. Any guidance would be appreciated.
Thank you.