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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
DukeAHolics
Regular Visitor

Method to Sum Totals Per Team Up To Maximum

Friends,

 

I have provided a simple sample dataset which essentially mirrors my data sample (just much smaller) in the first 3 columns with the 4th column an example of what I'm trying to automate. The teams can produce a total of 2 job lengths per day and they may touch multiple jobs per day totaling more than 2. I would like to show how much of each job each team will complete up to the full 2, and not over 2. Essentially, I want to sum the total job length for each team until I get to 2 or greater, then the last job should be the difference. If there is only one assigned job and it is greater than or equal to 2, it would just be "2". The column "Shift Job Length" is a sample of my desired outcome. Thoughts? Thank you!

 

TeamTeam AssignmentTotal Job LengthShift Job Length
Team 1.11.12.12
Team 2.12.10.20.2
Team 2.22.20.40.4
Team 2.32.31.91.4
Team 3.13.11.81.8
Team 3.23.22.00.2
Team 4.14.10.10.1
Team 4.24.20.20.2
Team 4.34.30.30.3
Team 4.44.40.20.2
Team 4.54.50.20.2
Team 4.64.61.41
1 REPLY 1
amitchandak
Super User
Super User

@DukeAHolics , Try a new column

 

New Column =
VAR _TA = 'Table'[Team Assignment]
VAR _JL = 'Table'[Total Job Length]
VAR _CL =
calculate(
sum('Table'[Total Job Length]),
filter(
'Table',
'Table'[Team Assignment] = _TA
&& 'Table'[Total Job Length] <= EARLIER(_JL)
)
)
return
IF(
_CL >= 2,
_JL - (_CL - 2),
_JL
)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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