Forum Discussion

irenelitw629's avatar
irenelitw629
Helper II
6 years ago
Solved

Build Calculated column in PowerBI query

Hi,

 

I am relatively new to powerBI.

 

I built a calculated column in the table as per below:

 

Territory = CALCULATE (
FIRSTNONBLANK ( vwAttainmentFileExport[Coverage Territory], 1 ),
FILTER ( ALL( vwAttainmentFileExport ), Enablement[Name] = vwAttainmentFileExport[Name]&& vwAttainmentFileExport[Quota Element]="Primary")
)
 
What is the equivelant formula for PowerBI query column?
I need to add column in the query in order to use "split the column" functions but I am having difficulty to write the query.
 
Thanks for your advice
 
 
  • irenelitw629 

     

    You may use code below to add a custom column.

    let
        r = _
    in
        Table.SelectRows(vwAttainmentFileExport, each ([Name] = r[Name]) and ([Quota Element] = "Primary")){0}[Coverage Territory]

     

2 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    irenelitw629 

     

    You may use code below to add a custom column.

    let
        r = _
    in
        Table.SelectRows(vwAttainmentFileExport, each ([Name] = r[Name]) and ([Quota Element] = "Primary")){0}[Coverage Territory]