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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
kenayabreu123
New Member

comparing columns

hello, I'm trying to create a calculated table with data from one that doesn't have the other. I am doing
Calculatetable ( FILTER (F_TABLE_1 , NOT CONTAINS (F_TABLE_2 , F_TABLE_2 [costumer_2 ] , F_TABLE_1 [costumer_1] ,  F_TABLE_2 [cod_2 ] , F_TABLE_1 [cod_1] )


this works, but first I want it to validate if the id of one is greater than the other I tried to do that
switch (TRUE () , FILTER ( F_TABLE_2 , F_TABLE_2 [ID_costumer_2 ]) > FILTER ( F_TABLE_1 , F_TABLE_1 [ID_costumer_1]) , Calculatetable ( FILTER (F_TABLE_1 , NOT CONTAINS (F_TABLE_2 , F_TABLE_2 [costumer_2 ] , F_TABLE_1 [costumer_1] ,  F_TABLE_2 [cod_2 ] , F_TABLE_1 [cod_1] )

 

but that doesn't work, I want it to first validate if the customer id of f_table_2 is greater than the id_customer of f_table_1 and then do the other validations

 

att: 

the customer id is the joining of the date in numeric format and a few more digits. With each passing day that number increases.

 

1 REPLY 1
technolog
Super User
Super User

Hi

 

You can use EXCEPT.

Example:

VAR SunMon =
    CALCULATETABLE (
        VALUES ( 'Date'[Day of Week] ),
        'Date'[Day of Week Number] IN { 1, 2 }
    )
VAR MonTue =
    CALCULATETABLE (
        VALUES ( 'Date'[Day of Week] ),
        'Date'[Day of Week Number] IN { 2, 3 }
    )
VAR ExceptResult = EXCEPT( SunMon, MonTue )
RETURN
    ExceptResult

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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