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 Experts,
I have 3 measures like you see from below picture:
Now I want to create the 4th measure = if the calculated workload is great than 1 (week) then automatically roll to the following week. e.g. the Trimming department workload in week 29 will be capped at 1 and the rest 1.33 (2.33 - 1 = 1.33) will be moved to the following week.
The total workload should be 3.68 weeks to complete (2.33+0.36+0.39+0.33+0.11+0.1+0.02+0.03+0.01 = 3.68 weeks)
Thank you,
Ray
Solved! Go to Solution.
You could do this by calculating the Life Time to Date Workload from the first week and then compare that to the running number of weeks. This produces the output in the bottom table below (ignore the total for the time being, I don't know if there is a meaningful way of calculating the capped workload at the total level - If you do have a requirement for calculating the total "capped workload" reply back letting me know how this should work and I'd be happy to update the measure)
I used the following 2 calculations to achieve the output above
LTD Workload = SUMX(FILTER(ALL('Date'[Date]), 'Date'[Date] <= MAX('Date'[Date])),[Workload])
Capped Workload = VAR _maxDate = CALCULATE(max('Date'[Date]), FILTER(VALUES('Date'[Date]), NOT( ISBLANK([LTD Workload])))) VAR _minDate = CALCULATE(min('Date'[Date]), FILTER(ALL('Date'[Date]), NOT( ISBLANK([Workload])))) VAR _weeksToDate = CALCULATETABLE(DISTINCT('Date'[Week of Year]), FILTER(ALL('Date'[Date]), 'Date'[Date] >= _minDate && 'Date'[Date] <= _maxDate)) VAR _runningWeekCount = COUNTROWS(_weeksToDate) VAR _runningWorkload = [LTD Workload] // SUMX(_weeksToDate, [Workload]) RETURN IF( _runningWorkload > _runningWeekCount, 1,IF(_runningWeekCount >=1 && _runningWeekCount-1 < _runningWorkload, _runningWorkload - (_runningWeekCount-1)))
You could do this by calculating the Life Time to Date Workload from the first week and then compare that to the running number of weeks. This produces the output in the bottom table below (ignore the total for the time being, I don't know if there is a meaningful way of calculating the capped workload at the total level - If you do have a requirement for calculating the total "capped workload" reply back letting me know how this should work and I'd be happy to update the measure)
I used the following 2 calculations to achieve the output above
LTD Workload = SUMX(FILTER(ALL('Date'[Date]), 'Date'[Date] <= MAX('Date'[Date])),[Workload])
Capped Workload = VAR _maxDate = CALCULATE(max('Date'[Date]), FILTER(VALUES('Date'[Date]), NOT( ISBLANK([LTD Workload])))) VAR _minDate = CALCULATE(min('Date'[Date]), FILTER(ALL('Date'[Date]), NOT( ISBLANK([Workload])))) VAR _weeksToDate = CALCULATETABLE(DISTINCT('Date'[Week of Year]), FILTER(ALL('Date'[Date]), 'Date'[Date] >= _minDate && 'Date'[Date] <= _maxDate)) VAR _runningWeekCount = COUNTROWS(_weeksToDate) VAR _runningWorkload = [LTD Workload] // SUMX(_weeksToDate, [Workload]) RETURN IF( _runningWorkload > _runningWeekCount, 1,IF(_runningWeekCount >=1 && _runningWeekCount-1 < _runningWorkload, _runningWorkload - (_runningWeekCount-1)))
Thank you d_gosbell,
I see the idea of the measures you wrote below and I had to adjust a little bit to suit my case as relationship between my tables are not connected by 'Date' but the weeknum because my Capacity Table only has weeknum colum and the capacity (they don't breakdown to daily capacity for me).
At the end I manage to use another graph to show what I wanna show so it is all good.
Thank you again for your reply and look into my problem I really appreciate it.
Cheers,
Ray
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.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |