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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
WaheedAli
Helper I
Helper I

How to compare two columns of a table and get the differences in another column

Hi guys, please bear with me. I am new with Power BI. I want to compare two columns of a table. In each column, within each cell there is another table (multiple values), on both the columns. I want to compare both the columns and create another calculated column, in which I want to get the differences or at least true of false. Attached image will explain it further. Thanks in advance.compare column.JPG

2 REPLIES 2
Anonymous
Not applicable

Hello @WaheedAli,

According to your description, I created some data to show:

1. You must select the expanded icon, expand the table, and display the data in columns and rows before you can compare.

v-yangliu-msft_1-1602734435141.jpeg

2. Create a calculated column to compare the difference between two columns or at least false.

Difference_column =
var _selectedDepartment= CALCULATE(SELECTEDVALUE(Merge1[Department ID]))
var _selectedProjectId= CALCULATE(SELECTEDVALUE(Merge1[Project ID]))
var _actualDepartment= CALCULATE(LOOKUPVALUE(Merge1[Master.Department ID],Merge1[Master.Project ID],_selectedProjectId))
var _result= IF(_actualDepartment=_selectedDepartment,TRUE(),FALSE())
return _result

3. Result

v-yangliu-msft_2-1602734435145.jpeg

You can download the PBIX file from here.

Best regards

Liu Yang

If this post helps,then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@WaheedAli , first you have to expand then as row/columns or maybe as list and then compare and take action.

 

@ImkeF  , Can you help with this.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.