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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Abhilekh
New Member

Calculate Table

Hi, 

 

I am new to Power BI and I am trying to create a dashboard to check for data gaps across different IT systems. 

I have 2 tables with around 40 columns each. I need to find out if the value in Table1 is exactly the same as value in Table 2, If not then the rows with unmatching values should be stored in another table. 

For Eg: Table 1 ( Employee ID , Firstname, Lastname, country) 

            Table 2 ( Employee ID, Firstname, Lastname, country )

 

Table to Calculate: ( Only Rows that do not match)

CountryMismatch( Employee ID, Firstname, Lastname, Table1.Country, Table2.Country) 

 

Table 1 and Table 2 relationship exists on EmployeeID which is a unique value. 

 

The idea is to build the dashboard capturing the count of mismatching values but also to have data of mismatching values for Audit purposes. I was able  to implement above on SQL and Mysql but would like to learn doing it in PowerBI. 

  

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Abhilekh,

 

Please check out the demo in the attachment. The formula could be as follows.

Table =
SELECTCOLUMNS (
    FILTER (
        NATURALINNERJOIN ( 'Table1', 'Table2' ),
        'Table1'[Country] <> 'Table2'[Country]
    ),
    "EmployeeID", 'Table1'[Employee ID],
    "Firstname", 'Table1'[Firstname],
    "Lastname", 'Table1'[Lastname],
    "Table1 Country", 'Table1'[Country],
    "Table2 Country", 'Table2'[Country]
)

table

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Abhilekh,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Abhilekh,

 

Please check out the demo in the attachment. The formula could be as follows.

Table =
SELECTCOLUMNS (
    FILTER (
        NATURALINNERJOIN ( 'Table1', 'Table2' ),
        'Table1'[Country] <> 'Table2'[Country]
    ),
    "EmployeeID", 'Table1'[Employee ID],
    "Firstname", 'Table1'[Firstname],
    "Lastname", 'Table1'[Lastname],
    "Table1 Country", 'Table1'[Country],
    "Table2 Country", 'Table2'[Country]
)

table

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.