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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.