Forum Discussion
Equal Values among columns
- 4 years ago
HI Kostas ,
Based on the expanation you mentioned, I got the following DAX: (I have added explanation at every condition checked in the DAX expression)
Compare = var cust = SELECTEDVALUE(orgData[Customer]) var emg = SELECTEDVALUE(orgData[Emerging]) var info = SELECTEDVALUE(orgData[InfoSec]) RETURN IF( cust = emg && cust = info && emg = info, "True", //checkng if all columns have same value IF( cust = BLANK() && emg = info, "True", // checking if one of columns is Blank and rest of the 2 have same value IF( emg = BLANK() && cust = info, "True", // checking if one of the 3 columns is Blank and rest of the 2 have same value IF( info = BLANK() && emg = cust, "True", // checking if one of the 3 columns is Blank and rest of the 2 have same value IF( cust = BLANK() && emg = BLANK() && info = BLANK(), "N/A", // checking if all the 3 columns are Blank IF( cust = BLANK() && emg = BLANK(), "N/A", // checking if any of the 2 columns are Blank IF( emg = BLANK() && info = BLANK(), "N/A", // checking if any of the 2 columns are Blank IF( cust = BLANK() && info = BLANK(), "N/A", // checking if any of the 2 columns are Blank "False" // remaining condition gets False which means no value is same in any of the 3 columns ) ) ) ) ) ) ) )When I move it to the table visual:
It seems to align with your explanation. Let me know if this is what you are looking for.
Thanks,
Pragati
HI Kostas ,
Based on the expanation you mentioned, I got the following DAX: (I have added explanation at every condition checked in the DAX expression)
Compare =
var cust = SELECTEDVALUE(orgData[Customer])
var emg = SELECTEDVALUE(orgData[Emerging])
var info = SELECTEDVALUE(orgData[InfoSec])
RETURN
IF(
cust = emg && cust = info && emg = info, "True", //checkng if all columns have same value
IF(
cust = BLANK() && emg = info, "True", // checking if one of columns is Blank and rest of the 2 have same value
IF(
emg = BLANK() && cust = info, "True", // checking if one of the 3 columns is Blank and rest of the 2 have same value
IF(
info = BLANK() && emg = cust, "True", // checking if one of the 3 columns is Blank and rest of the 2 have same value
IF(
cust = BLANK() && emg = BLANK() && info = BLANK(), "N/A", // checking if all the 3 columns are Blank
IF(
cust = BLANK() && emg = BLANK(), "N/A", // checking if any of the 2 columns are Blank
IF(
emg = BLANK() && info = BLANK(), "N/A", // checking if any of the 2 columns are Blank
IF(
cust = BLANK() && info = BLANK(), "N/A", // checking if any of the 2 columns are Blank
"False" // remaining condition gets False which means no value is same in any of the 3 columns
)
)
)
)
)
)
)
)
When I move it to the table visual:
It seems to align with your explanation. Let me know if this is what you are looking for.
Thanks,
Pragati
Hi,
That would work, I was just hoping for a better solution and easier solution.
In case that I got more than 3 columns then it becomes to complicated.
Thanks for the answer that would work for now.
Thanks