Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Compare value in the same column

Hi

 

I have table below : 

NameGroupValue
A120
B120
120
220
224
312
312
H312
412
420
K424
L412
M412
412

 

I would like to compare the value in the same group, all the values in the same group must be identical == > OK, If not KO 

The result is as below : 

NameGroupValueCoherence
A120OK
B120OK
120OK
220KO
224KO
312OK
312OK
H312OK
412KO
420KO
K424KO
L412KO
M412KO
412KO

thank oyu in advance for your help

  • pls try this

    Column = 
    VAR _Result = CALCULATE(DISTINCTCOUNT('Table'[Value]),ALLEXCEPT('Table','Table'[Group]))
    RETURN
    IF(_Result=1,"OK","KO")

  • pls try this

    Column = 
    VAR _Result = CALCULATE(DISTINCTCOUNT('Table'[Value]),ALLEXCEPT('Table','Table'[Group]))
    RETURN
    IF(_Result=1,"OK","KO")

  • Hi Anonymous ,

     

    Try this as a calc column:

    Coherence =
    IF (
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[Value] ),
            ALLEXCEPT ( 'Table', 'Table'[Group] )
        ) > 1,
        "KO",
        "OK"
    )
    

     

3 Replies

  • pls try this

    Column = 
    VAR _Result = CALCULATE(DISTINCTCOUNT('Table'[Value]),ALLEXCEPT('Table','Table'[Group]))
    RETURN
    IF(_Result=1,"OK","KO")

  • Hi Anonymous ,

     

    Try this as a calc column:

    Coherence =
    IF (
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[Value] ),
            ALLEXCEPT ( 'Table', 'Table'[Group] )
        ) > 1,
        "KO",
        "OK"
    )
    

     

  • pls try this

    Column = 
    VAR _Result = CALCULATE(DISTINCTCOUNT('Table'[Value]),ALLEXCEPT('Table','Table'[Group]))
    RETURN
    IF(_Result=1,"OK","KO")