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.
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?
Solved! Go to Solution.
Hi @Anonymous
You can add a calculated column like this:
Company join date = CALCULATE ( MIN ( Table1[User join date] ), ALLEXCEPT ( Table1, Table1[Company ID] ) )
Hi @Anonymous
You can add a calculated column like this:
Company join date = CALCULATE ( MIN ( Table1[User join date] ), ALLEXCEPT ( Table1, Table1[Company ID] ) )
Yep that's it! I really need to learn to use ALLEXCEPT more often. Thanks @AlB !
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |