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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ctedesco3307
Resolver II
Resolver II

Table.Group by aggregate from a RELATED column

I have a MSSDates table that has a relationship with my calendar table.  The MSSDates table has a RELATED column in it to identify the day as a working day or not,   I want to create a summary table that groups by opportunity and shows the total number of working days for each opportunity. Because the working days column is a related column in the table, I can't do it in "Transform Data" becasue the column does not show as an option to aggregrate. So I need to write the syntax for this in create table. I just can't get the syntax right.  All I need is 

Table.Group(Select.Columns(Project,Opportunity, WorkignDays)

group by Project, Opportunity, Sum(WorkingDays) 

 

ctedesco3307_0-1660748574080.png

 

 

1 ACCEPTED SOLUTION
ctedesco3307
Resolver II
Resolver II

GOT IT! take out the second SUM

 

Table = GROUPBY(MSSFlatFeeDates,MSSFlatFeeDates[Opportunity],"TotalDays",SUMX(CURRENTGROUP(),MSSFlatFeeDates[WorkingDay]))

View solution in original post

2 REPLIES 2
ctedesco3307
Resolver II
Resolver II

GOT IT! take out the second SUM

 

Table = GROUPBY(MSSFlatFeeDates,MSSFlatFeeDates[Opportunity],"TotalDays",SUMX(CURRENTGROUP(),MSSFlatFeeDates[WorkingDay]))
ctedesco3307
Resolver II
Resolver II

So - I got this far- but I'm not getting the right number - there should be 252 - 254 value (working days in a year) for each opportunity. Any pointers? thx in advance 

Table = GROUPBY(MSSFlatFeeDates,MSSFlatFeeDates[Opportunity],"TotalDays",SUMX(CURRENTGROUP(),SUM(MSSFlatFeeDates[WorkingDay])))

 

ctedesco3307_0-1660823055470.png

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.