Forum Discussion

dapling's avatar
dapling
Frequent Visitor
10 years ago
Solved

Summarising Two Fields into One

I am new to PowerBI, having been a reasonably advanced Excel user, particularly pivots.   I have two fields - Type and Scheme.   In Type, every record is either A, B and C. In Scheme, I have fie...
  • KGrice's avatar
    10 years ago

    You could do this in the Query Editor or by adding a new column in the Data View. For the Query Editor:

     

    From the main report view, go to the Home tab and click Edit Queries to get to the Query Editor. Find your query where you want the new column, then go to Add Column in the ribbon and click Add Custom Column. In the new window, change the New column name to Summary and enter the formula below:

     

    =if Text.Start([Scheme], 2) = "X:" then "X" else [Type]

     

    If you want to do it in Data View as a new column, you could use this formula:

     

    =IF(LEFT(TableName[Scheme], 2)="X:", "X", TableName[Type])