Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX function to check if data is consistent

Hi there!   I have a huge table with employee data from two data sources (SharePoint, SAP). My data looks like this: ID Name CC Entry date Leaving date Div BU Quitting reason Quitting ...
  • tamerj1's avatar
    tamerj1
    4 years ago

    Anonymous 
    This is the code for a calculated column

     

    Any Differences? = 
    VAR DistinctRows =
        COUNTROWS (
            DISTINCT (
                CALCULATETABLE (
                    SELECTCOLUMNS (
                        'Employee Data',
                        "@Name", [Name], "@CC", [CC], "@EntryDate", [Entry date], "@LeavingDate", [Leaving date],
                        "@@Div", [Div], "@BU", [BU], "@QuittingReason", [Quitting reason], "@QuittingType", [Quitting type],
                        "@WorkingHours", [Work hours], "@FTE", [FTE], "@Location", [Location], "@position", [Position]
                    ),
                    ALLEXCEPT ( 'Employee Data', 'Employee Data'[Name] )
                )
            )
        )
    RETURN
        IF ( DistinctRows = 2, "Yes", "" )