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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Premlatapandey9
Microsoft Employee
Microsoft Employee

Create a column based on the text data in other columns.

Hello Everyone,

Greetings for the day!

 

I have the below data set 

Family NamePart NoDescriptionSupplier
Compute123456COMPUTESTORAGE-TE-GEN5.8-INTEL-104-LENOVO-48U-STANDARDWWWT
Netapp123457NETAPP-STORAGE-GEN2.7-INTEL-103H-WWTFFFT
Compute123456COMPUTESTORAGE-TE-GEN5.8-INTEL-104-LENOVO-48U-STANDARDMGT
Netapp123457NETAPP-STORAGE-GEN2.7-INTEL-103H-WWTFFFT
Compute123456NETAPP-STORAGE-GEN2.7-INTEL-103H-WWTMGT

 

 and based on above i want to create a column name " Comment " like below

 

Family NamePart NoDescriptionSupplierComment
Compute123456COMPUTESTORAGE-TE-GEN5.8-INTEL-104-LENOVO-48U-STANDARDWWWTUnique Combo
Netapp123457NETAPP-STORAGE-GEN2.7-INTEL-103H-WWTFFFTDupe Combo
Compute123456COMPUTESTORAGE-TE-GEN5.8-INTEL-104-LENOVO-48U-STANDARDMGTOnly Supplier is different
Netapp123457NETAPP-STORAGE-GEN2.7-INTEL-103H-WWTFFFTDupe Combo
Compute123456NETAPP-STORAGE-GEN2.7-INTEL-103H-WWTMGTOnly Description is different

 

Can you please help me to write the DAX for this thank you in advance!

 @member ,  @dax 

3 REPLIES 3
tamerj1
Super User
Super User

Hi @Premlatapandey9 
Based on what?

Hello @tamerj1  applologies i have updated the above ask can you please have a look now, earlier the first table did not get posted Thanks!

@Premlatapandey9 
Please refer to attached sample file with the proposed solution

1.png

Comment = 
VAR IsDupe = COUNTROWS ( CALCULATETABLE ( 'Table', ALL ( 'Table'[Index] ) ) ) > 1
VAR FamilyPartTable = CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Family Name], 'Table'[Part No] ) )
VAR TableBefore = FILTER ( FamilyPartTable, 'Table'[Index] < EARLIER ( 'Table'[Index] ) )
VAR DescriptionsBefore = DISTINCT ( SELECTCOLUMNS ( TableBefore, "@Description", 'Table'[Description] ) )
VAR SuppliersBefore = DISTINCT ( SELECTCOLUMNS ( TableBefore, "@Supplier", 'Table'[Supplier] ) )
RETURN
    SWITCH (
        TRUE ( ),
        IsDupe, "Dupe Combo",
        ISEMPTY ( TableBefore ), "Unique Combo",
        'Table'[Description] In DescriptionsBefore, "Only Supplier is different",
        'Table'[Supplier] In SuppliersBefore, "Only Description is different",
        "Both Description and Supplier are different"
    )

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.