Dashboard Mode - Splitting and merging columns
Business Question
How can we split full customer names into first and last names, and merge city and state into a single location column for better analysis?
How can we split full customer names into first and last names, and merge city and state into a single location column for better analysis?
| CustomerID | FullName | City | State | Sales |
|---|---|---|---|---|
| 101 | John Smith | Seattle | WA | 250 |
| 102 | Mary Johnson | Portland | OR | 300 |
| 103 | James Lee | San Francisco | CA | 400 |
| 104 | Linda Davis | Denver | CO | 150 |
| 105 | Michael Brown | Seattle | WA | 350 |
=SUM(Sales) showing 1450FirstName and LastName created by splitting FullName at the space.City and State with a comma and space.Location showing total sales per city-state combination.
// Split FullName into FirstName
FirstName = LEFT(Customer[FullName], FIND(" ", Customer[FullName]) - 1)
// Split FullName into LastName
LastName = RIGHT(Customer[FullName], LEN(Customer[FullName]) - FIND(" ", Customer[FullName]))
// Merge City and State into Location
Location = Customer[City] & ", " & Customer[State]
// Total Sales measure
Total Sales = SUM(Customer[Sales])
+----------------------+-------------------------+ | Total Sales | Sales by Location | | (KPI Card) | (Bar Chart) | +----------------------+-------------------------+ | Customer Details Table (with split names and merged location) | +-----------------------------------------------------------------------------+
A slicer on Location allows filtering the bar chart and the customer details table to show only customers from the selected city-state. Selecting a location updates the total sales KPI to reflect sales only from that location.
If you add a filter for Location = "Seattle, WA", which components update and what will the total sales show?