Forum Discussion

Matas's avatar
Matas
Icon for Advocate II rankAdvocate II
4 years ago

DAX Comparing Columns and Vs

Hi,

 

I would like to request help regards my DAX measure that I cannot figure out. I have a table with columns VALUE and CALL_Point (which contain "VA02" and "EX02" values). I need to return the count of <> BLANK() from table[VALUE] where Table[CALL_POINT] = "VA02" and is not equal <> Table[VALUE] where Table[CALL_POINT] = "EX02".
Since the CALL_POINT "EX02" and "VA02" can contain the same value, which is fine, I need the ones that differ.

 

This is my current DAX measure, which returns the count of Table[VALUE] for CALL_POINT = "VA02" which does not contains BLANK values. 

OCR Validated Ratio =
var T1 = VALUES(Table[DOCID])
var T2 = ADDCOLUMNS(T1, "@NumOfBlanks", SUMX(FILTER(CALCULATETABLE(Table), Table[CALL_POINT] = "VA02"),
IF (Table[VALUE] <> BLANK(),1)
)
)
var T3 = FILTER(T2, [@NumOfBlanks] <> BLANK())
RETURN
COUNTROWS(T3)
 


Hopefully anyone can spend their time on helping me. Thanks in advance!

Regards,

Matas

 

2 Replies

  • Hi,

    I am not sure if I understood your question correctly, but please try the below measure.

     

    OCR Validated Ratio =
    VAR T1 =
        VALUES ( Table[DOCID] )
    VAR T2 =
        ADDCOLUMNS (
            T1,
            "@NumOfBlanks",
                CALCULATE (
                    COUNTROWS (
                        FILTER ( Table, Table[CALL_POINT] = "VA02" && Table[VALUE] <> BLANK () )
                    )
                )
        )
    VAR T3 =
        FILTER ( T2, [@NumOfBlanks] <> BLANK () )
    RETURN
        COUNTROWS ( T3 )
    
    • Matas's avatar
      Matas
      Icon for Advocate II rankAdvocate II

      Hi Jihwan_Kim 

       

      My question was, how can I optimize the current DAX measure so that the end result would compare CALL_POINT columns "VA02" and "EX02" values, that if for column CALL_POINT "VA02" and "EX02" value is not blank and not the same from the VALUE column, return the result. I have two columns.

       

      For example:

      From this example, the function should not return anything, since the EX_02 and VA_02 values are the same, but if it would be different then I should get a corresponding result. Hopefully, this made it easier to understand the issue I am facing.

       

      Regards,

      Matas