Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi im super new to power bi ,
The structure i have is 2 tables , programs and projects .
I need a simple new column in my programs table that counts the amount of projects for each program that i have
knowing that i have a one to many relationship with 1 program that have many projects.
Solved! Go to Solution.
NewColumn=COUNTROWS(RELATEDTABLE(Projects))
Hi @mabuzaid1993 ,
I do understand that you're new to Power BI, and I will do my best to explain the step as clearly as possible.
There are a few ways you can achieve the outcome:
Method 1:
1. Reference projects table, then apply "Group by" function to do the count.
How to use group by: Grouping or summarizing rows - Power Query | Microsoft Docs
Merge the above table from step 1 to the program table.
How to merge table: Merge queries overview - Power Query | Microsoft Docs
Method 2: Add a Custom Column and apply the formula below
Table.SelectRows(ProjectTableName, each (x)=> (x[ProjectTableColumnName] = [ProgramTableColumnName]) and (x[ProjectTableColumnName] = [ProgramTableColumnName]))
Condition1
Condition2
You can add more conditions, joining conditions with and / or.
If all the above does not make sense or does not meet your expectation.
Please kindly share some sample data with sensitive information removed, and a specific solution can be provided.
Regards
KT
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 17 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |