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
User_266
Frequent Visitor

Combine two column and total

Hello,

 

I have a Dataset with several columns, two of which look like this:

 

| Departure Country |     | Arrival Country |
| France |                         | Belgium |
| France |                         | Italy |
| Switzerland |                 | France |
| France |                         | Italy |
| France |                         | China |
| France |                         | Switzerland |
| Germany |                     | France |

 

I want to be able to count the number of appearances of each country in one of the two columns. Here for example I will have:

 

| Country "Index" |  | Total |

| France   |               | 7 |

| Switzerland  |        | 2 |

| Italy  |                    | 2 |

| Belgium |               | 1 |

| China |                   | 1 |

| Germany |              | 1 |

 

To do this I therefore need a column which combines the two departure and arrival columns into one, to be able to insert it into a table visualization with the number of appearances for each country.

 

Do you have an idea please?


Thanks !

1 ACCEPTED SOLUTION
Nithinr
Resolver III
Resolver III

To combine two columns as rows in Power BI , you can use the "Unpivot Columns" feature. 

  1. Select the columns you want to combine.  "Departure Country" and "Arrival Country" that you want to com

    bine as rows.

  2. Right-click  and choose "Unpivot Columns" from the context menu. This will transform the selected columns into rows.

  3. Rename the new columns as needed .

  4. Create a measure to get count.

 

Country Count = COUNTAX('Table', [Value])

 

 

View solution in original post

1 REPLY 1
Nithinr
Resolver III
Resolver III

To combine two columns as rows in Power BI , you can use the "Unpivot Columns" feature. 

  1. Select the columns you want to combine.  "Departure Country" and "Arrival Country" that you want to com

    bine as rows.

  2. Right-click  and choose "Unpivot Columns" from the context menu. This will transform the selected columns into rows.

  3. Rename the new columns as needed .

  4. Create a measure to get count.

 

Country Count = COUNTAX('Table', [Value])

 

 

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