Forum Discussion

AzePoi's avatar
AzePoi
Regular Visitor
3 years ago

Reduce multilines to single

Hi all, 

I'm a beginner... 

I have a table having CorpID, Attributes and Values. For each CorpID I have several Attributes with unique values. I'd like to convert my Attribute to have unique column per attribute but I'm having multiple "null" cells which does not allow me to retrieve Values per CorpID... Any idea on how to proceed? 

 

Table is as follow

Column 1; Column2; Column3

Corp1; Name; NameCorp1

Corp1; Address; AddressCorp1

Corp2; Address, AddressCorp2...

2 Replies

  • Adamboer's avatar
    Adamboer
    Responsive Resident

    It sounds like you want to pivot your attribute column and have each attribute value as a separate column for each CorpID, with the corresponding value filled in. However, there might be some null values in your data that are preventing you from retrieving the values per CorpID.

    One approach to this is to first replace the null values in your data with a default value. You can do this by creating a new calculated column with a formula that replaces the null values with a default value. For example, if you want to replace null values with "N/A", you can use the following formula:
    NewValue = IF(ISBLANK([Value]), "N/A", [Value])

     

    Once you have replaced the null values, you can then pivot the "Attribute" column to create separate columns for each attribute value. Here's an example of a DAX formula that uses the "PIVOT" function to pivot your data:

    PivotedTable = PIVOT(Table, Table[Attribute], Table[NewValue])

    This formula will pivot your data so that you have a separate column for each unique attribute value, with the corresponding values filled in for each CorpID.

    I hope this helps you get started! Let me know if you have any further questions or need additional assistance.