Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Help with validating data

Hey guys,

 

I need your help with a couple of calculated column or measures.


Below my sample data:

 

Source   Key Validation
a            3      Needs Checking
a            1      Needs Checking
a            1      Needs Checking
a            1      Needs Checking
a            1      Needs Checking
b            2      Good
b            2      Good
b            2      Good


What I need is for the "Validation" column to tell me if the source values contain more than 1 "Key" for each "Source". In the above sample, Source "b" is fine because it only has the Key "2", while Source "a" is not ok because it contains Key "1" four times and also Key "3".

 

Secondly, I also need to know if the same Key value is present in more than one Source. Below, another sample. In the sample, Key "3" is present in Source "a" and "C", which isn't ok.

Source   Key  Validation             Validation2
a            3      Needs Checking    Needs Checking
a            1      Needs Checking    Needs Checking
a            1      Needs Checking    Needs Checking
a            1      Needs Checking    Needs Checking
a            1      Needs Checking    Needs Checking
b            2      Good                      Good
b            2      Good                      Good
b            2      Good                      Good

c             3     Good                    Needs Checking

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

For the first one:

Validation Column =
  IF(
    COUNTROWS(
      SUMMARIZE(
        FILTER('Table',[Source] = EARLIER([Source]),
        [Key]
      )
    ) > 1,
    "Needs Checking",
    "Good"
  )

For the second:

Validation Column 2 =
  IF(
    COUNTROWS(
      SUMMARIZE(
        FILTER('Table',[Key] = EARLIER([Key]),
        [Source]
      )
    ) > 1,
    "Needs Checking",
    "Good"
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you Greg, your solutions work. 

 

For future people who need this, there is a ")" missing after each EARLIER([Key]),

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.