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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
DiogoPS
New Member

How to Count Airport Codes from 2 columns

Hi team,

My first post here. I'm new to the PowerBI world and I'm facing a challenge that I hope that should be simple to execute.

I have a spreadsheet that I exported from my FlightDiary with 2 colums; Origin and Destination. These 2 columns have Airports codes (for example: JFK, BOS, LAX, GRU, MCO,..)

 

What I want to do is to create a visual where I have the full list of airports and the total number of trips. For example:

 

DiogoPS_0-1701982154530.png

 

In this picture, I want to have the aiport GIG showing 4 and BEL showing a total of 3 trips (among origins and destinations). So, basically I want to count the aiport codes within 2 columns.

 

I even created another table with the aiport code lookup to stablish a relation between both tables, but I can only connect 1 column from one table to 1 column from another table...

 

Is there a best and esasy way to make this happen?

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@DiogoPS 

should GIG be 5 based on the sample data you provided?

1. create an index column in pq

11.PNG

2. select index column and unpivot other columns

12.png

13.PNG

then you can drag the columns to visual to get what you want

15.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@DiogoPS 

should GIG be 5 based on the sample data you provided?

1. create an index column in pq

11.PNG

2. select index column and unpivot other columns

12.png

13.PNG

then you can drag the columns to visual to get what you want

15.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It worked! Thanks a lot!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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