This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Your file has been submitted successfully. We’re processing it now - please check back in a few minutes to view your report.
Came out of this conversation: Create Origin To Destination Map In BI Desktop - Microsoft Fabric Community. Here's a way to create origin to destination lines on a map given a table of cities.
CityLatitudeLongitude
| Columbus, OH | 39.9611111 | -82.9988889 |
| London, UK | 51.5 | -0.116667 |
| Kansas City | 39.099912 | -94.581213 |
| St. Louis | 38.627089 | -90.200203 |
From and To =
VAR __NumSteps = 100
VAR __Steps = SELECTCOLUMNS( GENERATESERIES( 1, __NumSteps, 1 ), "Step", [Value] )
VAR __BaseTable =
FILTER(
GENERATE(
SELECTCOLUMNS( 'Cities', "From City", [City], "From Long", [Longitude], "From Lat", [Latitude] ),
SELECTCOLUMNS( 'Cities', "To City", [City], "To Long", [Longitude], "To Lat", [Latitude] )
),
[From City] <> [To City]
)
VAR __String = CONCATENATEX( __BaseTable, [From City] & "^" & [From Long] & "^" & [From Lat] & "^" & [To City] & "^" & [To Long] & "^" & [To Lat], "|" )
VAR __Count = COUNTROWS( __BaseTable )
VAR __Table =
ADDCOLUMNS(
GENERATESERIES( 1, __Count ),
"__Data", SUBSTITUTE( PATHITEM( __String, [Value] ), "^", "|" )
)
VAR __Result =
FILTER(
SELECTCOLUMNS(
ADDCOLUMNS(
GENERATE(
__Table,
__Steps
),
"Latitude", PATHITEM( [__Data], 3 ) + ( [Step] / __NumSteps ) * ( PATHITEM( [__Data], 6 ) - PATHITEM( [__Data], 3 ) ),
"Longitude", PATHITEM( [__Data], 2 ) + ( [Step] / __NumSteps) * ( PATHITEM( [__Data], 5 ) - PATHITEM( [__Data], 2 ) )
),
"Latitude", [Latitude],
"Longitude", [Longitude],
"From", PATHITEM( [__Data], 1 ),
"To", PATHITEM( [__Data], 4 )
),
[From] <> [To]
)
RETURN
__Result
eyJrIjoiMDZkNjhlMmItZTg1ZC00ZmM2LTkwZTEtNDJiZDA3ZGFlNDRjIiwidCI6Ijg3NDlmOWI5LWYzMmQtNDdhMS1hMjI0LTM2OTQxOGFlMmY1MSJ9
Awesome! Great sample using the Azure Maps Visual in Power BI! For anyone that wants to try, check out Get started with Azure Maps Power BI visual - Microsoft Azure Maps | Microsoft Learn