Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.