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

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.

Reply
pchilton
Frequent Visitor

Need help counting rows in another table and populating cells with those counts

I need assistance, I am new to PowerBI and especially DAX. I am trying to write a bug arrival report that includes days with 0 bugs written and days where there is a record in my source VSTS data. I was able to use PowerBI to create a report, but it did not include days where there were no bugs entered because those records did not exist in the source data. I am trying to create another table to use in my graphing.

 

VSTS Source Data

VSTS Source.png

Below is a  Table I created with Columns: Date, Period and CreatedDate.

 

I want the values in CreatedDate in the DatePeriod table to equal the number of instances found in the CreatedDate column from VSTS.  Currently my code is bringing back the total number of records in the VSTS table and populates each row in the CreatedDate column regardless of bugs written on a particular day. It does not seem like it should be rocket science to do this, but I am hitting a brick wall and have run out of ways to search google for where this has been solved elsewhere. Any help would be greatly appreciated.

 

DatePeriodTable.png

2 ACCEPTED SOLUTIONS
Phil_Seamark
Employee
Employee

Hi @pchilton

 

If you add the following calculated column to your 'Date' table, it will return a count or child rows from the 'WorkItemsView' table, so long as you have a relationship between the two tables

 

Created Date = COUNTROWS(RELATEDTABLE('WorkItemsView'))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Well, that was easy.  Thank you very much!

View solution in original post

2 REPLIES 2
Phil_Seamark
Employee
Employee

Hi @pchilton

 

If you add the following calculated column to your 'Date' table, it will return a count or child rows from the 'WorkItemsView' table, so long as you have a relationship between the two tables

 

Created Date = COUNTROWS(RELATEDTABLE('WorkItemsView'))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Well, that was easy.  Thank you very much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.