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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
akfir
Helper V
Helper V

Customer status in a specific date

I have to data tables: 
1. Status changes of customers:

akfir_0-1684737275920.png

2. Orders:

akfir_1-1684737325538.png

I wish to add a column to Orders table which presents the customer status as of each customer at its order date, as below:

akfir_2-1684737489332.png

Thanks in advance

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @akfir 

please try

Status While Ordering =
MAXX (
TOPN (
1,
FILTER (
ALL ( StatusChanges ),
StatusChanges[Customer Code] = Orders[Customer Code]
&& StatusChanges[Date] <= Orders[Date]
),
StatusChanges[Date]
),
StatusChanges[New Status]
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @akfir 

please try

Status While Ordering =
MAXX (
TOPN (
1,
FILTER (
ALL ( StatusChanges ),
StatusChanges[Customer Code] = Orders[Customer Code]
&& StatusChanges[Date] <= Orders[Date]
),
StatusChanges[Date]
),
StatusChanges[New Status]
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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