Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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