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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Return the first date based on other column

Hi,

I have a Customers table with a Customer ID, a User ID and a User Join Date. Every row contains a unique User ID. A Company ID can have multiple User ID’s assigned to it.

 

User ID

Company ID

User join date

1

A

1-1-2015

2

A

2-2-2015

3

B

3-3-2015

4

B

4-4-2015

5

B

5-5-2015

6

C

6-6-2015

7

D

7-7-2015

8

D

8-8-2015

 

 

I want to add a column that tells me on a Company ID level when the first user joined. The ideal result would look like this:

 

 

User ID

Company ID

User join date

Company join date

1

A

1-1-2015

1-1-2015

2

A

2-2-2015

1-1-2015

3

B

3-3-2015

3-3-2015

4

B

4-4-2015

3-3-2015

5

B

5-5-2015

3-3-2015

6

C

6-6-2015

6-6-2015

7

D

7-7-2015

7-7-2015

8

D

8-8-2015

7-7-2015

 

How to do that?

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

 

You can add a calculated column like this: 

 

 

Company join date =
CALCULATE (
    MIN ( Table1[User join date] ),
    ALLEXCEPT ( Table1, Table1[Company ID] )
)

 

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @Anonymous 

 

You can add a calculated column like this: 

 

 

Company join date =
CALCULATE (
    MIN ( Table1[User join date] ),
    ALLEXCEPT ( Table1, Table1[Company ID] )
)

 

Anonymous
Not applicable

Yep that's it! I really need to learn to use ALLEXCEPT more often. Thanks @AlB !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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