Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kellyylx
Helper I
Helper I

Create a custom column in transform from table view

I have created a new column for my data under table view:

 

1 Exact Name =
VAR CurrentCol = 'Aus'[Account Name]
VAR _count = COUNTROWS(
    FILTER('Aus',
    'Aus'[Account Name] = CurrentCol
    )
)
RETURN IF(_count >= 2 && 'Aus'[Active]="TRUE", true, false)
I want to create this column under transform data instead as i want to append multiple tables with new columns after. 
 
How can I do so?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kellyylx 

 

Please try this:

Here I create a set of sample:

vzhengdxumsft_0-1725332843145.png

In power query, click the Custom Column then paste the code:

let
_currentAccountName = [Account Name]
in 
if List.Count(List.Select( Source [Account Name],each _=_currentAccountName))>2 and [Active]="TRUE" then true else false

The result is as follow:

vzhengdxumsft_1-1725332950487.png

 

Best Regards

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @kellyylx 

 

Please try this:

Here I create a set of sample:

vzhengdxumsft_0-1725332843145.png

In power query, click the Custom Column then paste the code:

let
_currentAccountName = [Account Name]
in 
if List.Count(List.Select( Source [Account Name],each _=_currentAccountName))>2 and [Active]="TRUE" then true else false

The result is as follow:

vzhengdxumsft_1-1725332950487.png

 

Best Regards

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

Thejeswar
Super User
Super User

@kellyylx ,

In addition to @Kenneth447Steel suggested, in case if your column is of Boolean data type, you might have to slightly change the logic as below

let
CurrentCol = [Account Name],
_count = List.Count(List.Select(Source[Account Name], each _ = CurrentCol))
in
if _count >= 2 and [Active] = true then true else false

 

Regards,

Kenneth447Steel
New Member

Hello!

To create the column in Power Query Editor, go to Home > Transform data. In the editor, select your table, then Add Column > Custom Column. Use this formula:

let
Source = ...,
AddCustom = Table.AddColumn(Source, "Exact Name", each
let
CurrentCol = [Account Name],
_count = List.Count(List.Select(Source[Account Name], each _ = CurrentCol))
in
if _count >= 2 and [Active] = "TRUE" then true else false
)
in
AddCustom

Apply and close to create the column. This allows you to append multiple tables with the new columns.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.