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
Raul
Post Patron
Post Patron

New column with Group by column

Hello,

I have this table in a PowerBI file:

IdCodeDescriptionValue
1C1D1Value1
2C1D2Value2
3C1D3Value3
4C1D4X
5C2D1Value5
6C2D2Value6
7C2D3Value7
8C2D4Y
9C3D1Value9
10C3D2Value10
11C3D3Value11
12C3D4Y
13C4D1Value12
14C4D2Value13
15C4D3Value8
16C4D4X
17C5D1Value16
18C5D2Value17
19C5D3Value4
20C5D4Y

 

And I need a new column that have the D4 value of the Description  column for each group of Code column, like this:

IdCodeDescriptionValueNewColumn
1C1D1Value1X
2C1D2Value2X
3C1D3Value3X
4C1D4XX
5C2D1Value5Y
6C2D2Value6Y
7C2D3Value7Y
8C2D4YY
9C3D1Value9Y
10C3D2Value10Y
11C3D3Value11Y
12C3D4YY
13C4D1Value12X
14C4D2Value13X
15C4D3Value8X
16C4D4XX
17C5D1Value16Y
18C5D2Value17Y
19C5D3Value4Y
20C5D4YY

Which formula have I to make for this new column?

Thanks!!!!

1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

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"
                    )
                   )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Phil_Seamark
Microsoft Employee
Microsoft Employee

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"
                    )
                   )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Thanks a lot!!

Works perfectly.

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