Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Compare value in the same column

Hi

 

I have table below : 

NameGroupValue
A120
B120
C 120
D 220
E 224
F 312
G 312
H312
I 412
J 420
K424
L412
M412
N 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
C 120OK
D 220KO
E 224KO
F 312OK
G 312OK
H312OK
I 412KO
J 420KO
K424KO
L412KO
M412KO
N 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")