cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper IV

## Compare value in the same column

Hi

I have table below :

 Name Group Value A 1 20 B 1 20 C 1 20 D 2 20 E 2 24 F 3 12 G 3 12 H 3 12 I 4 12 J 4 20 K 4 24 L 4 12 M 4 12 N 4 12

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 :

 Name Group Value Coherence A 1 20 OK B 1 20 OK C 1 20 OK D 2 20 KO E 2 24 KO F 3 12 OK G 3 12 OK H 3 12 OK I 4 12 KO J 4 20 KO K 4 24 KO L 4 12 KO M 4 12 KO N 4 12 KO

thank oyu in advance for your help

3 ACCEPTED SOLUTIONS
Super User

pls try this

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

Super User

pls try this

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

Super User

Hi @vnqt ,

Try this as a calc column:

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

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Connect to me on LinkedIn || Need consulting? Hire me for a Power BI gig on UpWork.
Learn with me on YouTube @PowerBITambayan.
3 REPLIES 3
Super User

Hi @vnqt ,

Try this as a calc column:

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

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Connect to me on LinkedIn || Need consulting? Hire me for a Power BI gig on UpWork.
Learn with me on YouTube @PowerBITambayan.
Super User

pls try this

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

Super User

pls try this

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

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors