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
Mani_1
Frequent Visitor

Adding coloumn to table based on filter

Hi,

I am trying to add a coloum company in table 1 based only with type "a", I have tried various dax measure but didn't succeed. Please help me with issue. The data is as follows, 

Thanks in advance

@amitchandak @Greg_Deckler @parry2k 

Table 1:

File
123
456
789
917
CompanyType

File

XX companyar123
Xy company

a

123
bS companyar456
XZ companya2456
by companya456
ca companya3789
ce companya789
cf companya3917
dl companya971
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Mani_1 assuming there is relationship between Table1 and Company table, and the relationship is 1 to many (one on Table1 side), add following calculated column in Table1

 

Company = 
VAR __Table = 
SELECTCOLUMNS ( 
    FILTER ( 
        RELATEDTABLE ( Company ), Company[Type] = "A" 
    ), 
    "@Company", Company[Company] 
)
RETURN MINX ( __Table, [@Company] )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@Mani_1 assuming there is relationship between Table1 and Company table, and the relationship is 1 to many (one on Table1 side), add following calculated column in Table1

 

Company = 
VAR __Table = 
SELECTCOLUMNS ( 
    FILTER ( 
        RELATEDTABLE ( Company ), Company[Type] = "A" 
    ), 
    "@Company", Company[Company] 
)
RETURN MINX ( __Table, [@Company] )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Mani_1 the file value is unique or you can have duplicate values in table1?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k 

In table 1 the file value is unique.

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