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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
dw700d
Post Patron
Post Patron

Count occurrences

I have two tables, a project table and a task table.  The project table contains 6 different projects. The task table contains any project that has a task. I would like to create a measure that calculates the total count of all tasks associated with each project name on the Project Table. Projects that do not have a task(currently not on the task table) should be assigned a 0 . For example Water works has two tasks because it has "task A" & "Task B" but Moon has 0 because it is not on the Task table. My desired outcome is at the bottom

 

Project Table

Project Name
Water works
Samsung
Intel
Moon  
Conway
Earth

 

TASK TABLE

Project NameTask
Water worksA
Water worksB
SamsungC
SamsungD
SamsungE
ConwayF

 

Desired Outcome

Project NameTASK
Water works2
Samsung3
Intel0
Moon  0
Conway1
Earth0
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@dw700d , One is you can join project and task table on project name and create a measure

 

count(Task[Task])+0

 

And display it with project name from project

 

or create a new column in project

tasks = countx(filter(Task, task[project name] = project[project name]) , Task[Task]) +0 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@dw700d , One is you can join project and task table on project name and create a measure

 

count(Task[Task])+0

 

And display it with project name from project

 

or create a new column in project

tasks = countx(filter(Task, task[project name] = project[project name]) , Task[Task]) +0 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.