Forum Discussion

chratnaa5's avatar
chratnaa5
Frequent Visitor
4 years ago
Solved

Remove column based on condition

Hi All, I have multiple columns with mulitple producted. I would like to filter or prepare report customer Vs products not opted. For Example: Table 1: Customer_Num Customer_Name Location Man...
  • v-kkf-msft's avatar
    4 years ago

    Hi chratnaa5 ,

     

    First select the Customer_Num and Customer_Name, then unpivot other columns. 

     

     

    If you have a requirement for the order between columns in the matrix, you can add that custom column to sort the Attribute column. 

     

    = if [Attribute] = "Opted" then 11 else if [Attribute] = "NotApplicable" then 12 else if [Attribute] = "Not Opted" then 13 else Text.Select([Attribute], {"0".."9"})

     

    Then create and use the following measure.

     

    Measure = 
    CALCULATE (
        MAX ( 'Table 2'[Value] ),
        FILTER (
            'Table 2',
            'Table 2'[Value] = "N" 
                || ( 'Table 2'[Attribute] = "Not Opted" && MAX ( 'Table 2'[Value] ) <> "0" )
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.