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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
mno3nrg
Frequent Visitor

Show migration between sales channels

Hello, I'm new to DAX and I'm unfortunately not getting anywhere at this point. I have a table with sales data. Each sale is assigned to a sales channel. I want to use a Sankey chart to show how customers churn between sales channels when they order multiple times.

My thought was: I use the sales channel column given so far and add another column which contains the sales channel of the next order, if there is another order. So it should show the next sales channel if the customer number stays the same and the column "Order / Customer" grows by 1. Unfortunately I have no idea how to formulate this in DAX.

In Sankey I would use the actual sales channel as the start and the new column as the target. Does this make sense, and what would happen if customers order only once and then the new column remains empty?

Here is my current table with orders:

order_idcustomer_idsales channelorder / customerfollowing sales channel
111Amazon1ebay
211ebay2-
312Amazon1-
413Shop1Amazon
613Amazon2Amazon
713Amazon3-

 

If my approach does not make sense, please feel free to give me a better suggestion. It doesn't matter how, but I would like to be able to show the churn between distribution channels.

Thank you very much!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mno3nrg , In case you need following sales channel, a new column

 

following sales channel =
var _max = minx(filter(Table, [customer_id] =earlier([customer_id]) && [order_id] > earlier([order_id])),[order_id])
return
maxx(filter(Table, [customer_id] =earlier([customer_id]) && [order_id] =_max ),[sales channel])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@mno3nrg , In case you need following sales channel, a new column

 

following sales channel =
var _max = minx(filter(Table, [customer_id] =earlier([customer_id]) && [order_id] > earlier([order_id])),[order_id])
return
maxx(filter(Table, [customer_id] =earlier([customer_id]) && [order_id] =_max ),[sales channel])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.