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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors