Forum Discussion
Filter 2 Columns In A Table Into A Single Column With True/False
Anonymous , in DAX
if(not(isblank([EMPLOYEE_ID])) && Not(isblank( [E_PRIMARY_EMPLOYEE_ID] )) && [EMPLOYEE_ID] =[E_PRIMARY_EMPLOYEE_ID] , true(), false() )
in power query
if [EMPLOYEE_ID] <> null and [E_PRIMARY_EMPLOYEE_ID] <> null and [EMPLOYEE_ID] =[E_PRIMARY_EMPLOYEE_ID] then true else false
- Anonymous4 years agoNot applicable
Hi Amit -
This is getting closer but it still returns a value even when one or both columns have blank values in them. Is there a way to perform this comparison but leave the cell blank if one or both columns contain a blank?
- v-xiaotang4 years agoCommunity Support
Hi Anonymous
If you want to perform this comparison but leave the cell blank, try this,
DAX code:
Column = IF ( NOT ( ISBLANK ( 'Table'[EMPLOYEE_ID] ) ) && NOT ( ISBLANK ( 'Table'[E_PRIMARY_EMPLOYEE_ID] ) ) && 'Table'[EMPLOYEE_ID] = 'Table'[E_PRIMARY_EMPLOYEE_ID], 1, BLANK () )M code:
if [EMPLOYEE_ID] <> null and [E_PRIMARY_EMPLOYEE_ID] <> null and [EMPLOYEE_ID] =[E_PRIMARY_EMPLOYEE_ID] then 1 else null // M code, in power queryBest Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.