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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

True/False column based off other rows in a table

hello

 

I would like to create a column that gives a TRUE/FALSE result when looking at matching criteria in other rows in a table.

 

I would like to check if a USER_ID, LOCATION_ID & DATE match. The Result would look like the below table. Rows 1 & 2 have the same criteria, so the answer is TRUE

 

Thanks

 

USER_IDLOCATION_IDDATETRUE/FALSE
1501/01/2022TRUE
1501/01/2022TRUE
3301/01/2022FALSE
4301/01/2022FALSE
1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Please create a column as below:-

TRUE/FALSE = 
VAR result =
    COUNTROWS (
        FILTER (
            'Table (4)',
            'Table (4)'[USER_ID] = EARLIER ( 'Table (4)'[USER_ID] )
                && 'Table (4)'[LOCATION_ID] = EARLIER ( 'Table (4)'[LOCATION_ID] )
                && 'Table (4)'[DATE] = EARLIER ( 'Table (4)'[DATE] )
        )
    )
RETURN
    IF ( result > 1, TRUE (), FALSE () )

Output;-

Samarth_18_0-1654088809861.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

2 REPLIES 2
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Please create a column as below:-

TRUE/FALSE = 
VAR result =
    COUNTROWS (
        FILTER (
            'Table (4)',
            'Table (4)'[USER_ID] = EARLIER ( 'Table (4)'[USER_ID] )
                && 'Table (4)'[LOCATION_ID] = EARLIER ( 'Table (4)'[LOCATION_ID] )
                && 'Table (4)'[DATE] = EARLIER ( 'Table (4)'[DATE] )
        )
    )
RETURN
    IF ( result > 1, TRUE (), FALSE () )

Output;-

Samarth_18_0-1654088809861.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Thank you @Samarth_18  it works a dream

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.