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.
Hello,
I have this table in a PowerBI file:
Id | Code | Description | Value |
1 | C1 | D1 | Value1 |
2 | C1 | D2 | Value2 |
3 | C1 | D3 | Value3 |
4 | C1 | D4 | X |
5 | C2 | D1 | Value5 |
6 | C2 | D2 | Value6 |
7 | C2 | D3 | Value7 |
8 | C2 | D4 | Y |
9 | C3 | D1 | Value9 |
10 | C3 | D2 | Value10 |
11 | C3 | D3 | Value11 |
12 | C3 | D4 | Y |
13 | C4 | D1 | Value12 |
14 | C4 | D2 | Value13 |
15 | C4 | D3 | Value8 |
16 | C4 | D4 | X |
17 | C5 | D1 | Value16 |
18 | C5 | D2 | Value17 |
19 | C5 | D3 | Value4 |
20 | C5 | D4 | Y |
And I need a new column that have the D4 value of the Description column for each group of Code column, like this:
Id | Code | Description | Value | NewColumn |
1 | C1 | D1 | Value1 | X |
2 | C1 | D2 | Value2 | X |
3 | C1 | D3 | Value3 | X |
4 | C1 | D4 | X | X |
5 | C2 | D1 | Value5 | Y |
6 | C2 | D2 | Value6 | Y |
7 | C2 | D3 | Value7 | Y |
8 | C2 | D4 | Y | Y |
9 | C3 | D1 | Value9 | Y |
10 | C3 | D2 | Value10 | Y |
11 | C3 | D3 | Value11 | Y |
12 | C3 | D4 | Y | Y |
13 | C4 | D1 | Value12 | X |
14 | C4 | D2 | Value13 | X |
15 | C4 | D3 | Value8 | X |
16 | C4 | D4 | X | X |
17 | C5 | D1 | Value16 | Y |
18 | C5 | D2 | Value17 | Y |
19 | C5 | D3 | Value4 | Y |
20 | C5 | D4 | Y | Y |
Which formula have I to make for this new column?
Thanks!!!!
Solved! Go to Solution.
Hi @Raul
I think this column might be close. Just chage where I have Table4 to be the name of your table.
NewColumn = CALCULATE( MAX('Table4'[Value]), FILTER( ALLEXCEPT( 'Table4', Table4[Code] ), [Description]="D4" ) )
Hi @Raul
I think this column might be close. Just chage where I have Table4 to be the name of your table.
NewColumn = CALCULATE( MAX('Table4'[Value]), FILTER( ALLEXCEPT( 'Table4', Table4[Code] ), [Description]="D4" ) )
Thanks a lot!!
Works perfectly.
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 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |