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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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])