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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PoorBIGuy
Frequent Visitor

How to find the first value of a group and present both "first" and "subsequent" in one window?

First of all, sorry for the long-ass title and thank you all in advance for reading and helping!

 

I have a data set like this in the BI:

PoorBIGuy_0-1717443685697.png

 

What I am thinking about is that I hope to know which store the customer made the first purchase based on the date (5th Ave for A and Bloomingdales for B). Then I hope to see if where the custmer made subsequent purchases (maybe in the same store as the first purchaes or different stores), and I have this table in mind:

PoorBIGuy_1-1717443860991.png

I wonder if it's doable to have this table in BI or maybe have the data set ready and I can populate this tab in Excel.

 

Many thanks for the help!

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You can get this type of result...

jgeddes_0-1717447826302.png

I achieved this with a combination of Power Query and DAX.

In Power Query you would sort and buffer your table by date (ascending), group your table by customer without aggregation (all rows) and then add an index column to the nested customer tables that explicitly dictates the purchase order. 
Load that into the desktop editor and you can create six measures. The first purchase store (Min store value when purchase order = 1), first purchase total (sum of spending when purchase order = 1) and then a measure for each store that sums the spending value when purchase order <> 1 && store = the store in question. From there put the measures into a matrix visual and play with the formatting to get the results you desire.
Hope this gets you pointed in the right direction.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
jgeddes
Super User
Super User

You can get this type of result...

jgeddes_0-1717447826302.png

I achieved this with a combination of Power Query and DAX.

In Power Query you would sort and buffer your table by date (ascending), group your table by customer without aggregation (all rows) and then add an index column to the nested customer tables that explicitly dictates the purchase order. 
Load that into the desktop editor and you can create six measures. The first purchase store (Min store value when purchase order = 1), first purchase total (sum of spending when purchase order = 1) and then a measure for each store that sums the spending value when purchase order <> 1 && store = the store in question. From there put the measures into a matrix visual and play with the formatting to get the results you desire.
Hope this gets you pointed in the right direction.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors