Forum Discussion

Teena_Pa4's avatar
Teena_Pa4
Frequent Visitor
7 years ago

Select columns using column name

Hi,

 

New to Power BI here... I have a table with a column that I need to pivot. After pivoting, I need to sum up several pivoted columns containing a specific keyword in their column names. Could you please advise how to achieve this?

 

Thank you.

5 Replies

  • Could you please share some example data ?

     

    Regards

    • Teena_Pa4's avatar
      Teena_Pa4
      Frequent Visitor

      Hi,

       

      I have columns like Sales_A, Sales_B, Incentives, Bonus, Sales_C. How can I create a new column to sum up columns where column name contains "Sales"?

       

      Thanks.

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Microsoft Employee

        Hi Teena_Pa4,

         

        Can you sum them up like below?

         

        Measure =
        SUM ( 'table'[Sales_A] ) + SUM ( 'table'[Sales_B] ) + SUM ( 'table'[Sales_C] )
        

         

        Best Regards,
        Dale