Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 !
Solved! Go to Solution.
To combine two columns as rows in Power BI , you can use the "Unpivot Columns" feature.
Select the columns you want to combine. "Departure Country" and "Arrival Country" that you want to com
bine as rows.
Right-click and choose "Unpivot Columns" from the context menu. This will transform the selected columns into rows.
Rename the new columns as needed .
Create a measure to get count.
Country Count = COUNTAX('Table', [Value])
To combine two columns as rows in Power BI , you can use the "Unpivot Columns" feature.
Select the columns you want to combine. "Departure Country" and "Arrival Country" that you want to com
bine as rows.
Right-click and choose "Unpivot Columns" from the context menu. This will transform the selected columns into rows.
Rename the new columns as needed .
Create a measure to get count.
Country Count = COUNTAX('Table', [Value])
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |