The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Number of Containers Delivered (Daily):
Every day, only a limited number of containers can be delivered based on the available capacity.
Number of Containers Pending Delivery (Daily):
This is the number of containers that are still waiting to be delivered.
Total Containers (Daily):
This is the sum of:
Market | Date | Max eta date | No of containers arrived | Capacity | No of containers deliverd | pending | Total |
India | 11-11-2024 | 11-11-2024 | 23 | 5 | 5 | 18 | |
India | 12-11-2024 | 12-11-2024 | 24 | 5 | 5 | 37 | 42 |
India | 13-11-2024 | 5 | 5 | 32 | 37 | ||
India | 14-11-2024 | 5 | 5 | 27 | 32 | ||
India | 15-11-2024 | 5 | 5 | 22 | 27 | ||
India | 16-11-2024 | 5 | 5 | 17 | 22 | ||
India | 17-11-2024 | 5 | 5 | 12 | 17 | ||
India | 18-11-2024 | 5 | 5 | 7 | 12 | ||
India | 19-11-2024 | 5 | 5 | 2 | 7 | ||
India | 20-11-2024 | 20-11-2024 | 3 | 5 | 5 | 0 | 5 |
India | 21-11-2024 | 21-11-2024 | 5 | 5 | -5 | 0 | |
India | 22-11-2024 | 22-11-2024 | 5 | 5 | 5 | -5 | 0 |
India | 23-11-2024 | 23-11-2024 | 5 | 5 | -10 | -5 | |
India | 24-11-2024 | 24-11-2024 | 5 | 5 | -15 | -10 |
Solved! Go to Solution.
Hi @tkavitha911 this will just show row number, for looping purposes, like this
Hi @tkavitha911 , Thank you for reaching out to the Microsoft Community Forum.
Based on your description, I took some sample data and worked out the solution.
Please refer attached .pbix file for reference and share your thoughts.
If this helped solve the issue, please consider marking it “Accept as Solution” so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hello @tkavitha911 , Just getting back to see if the shared details answered your question. If so, marking it as "Accept as Solution" would be greatly appreciated to guide others in the community. Feel free to reach out with any additional questions!
Hi @tkavitha911 , I hope you're doing well! Just checking in to see if you had a chance to review the details shared earlier. If any of the information addressed your needs, feel free to mark it as "Accept as Solution" to help others in the community. Please let me know if you have any further questions!
Hi @tkavitha911 , I wanted to check with you and see if the provided information was useful. If any of it helped resolve your question, consider marking it as "Accept as Solution" to make it easier for others to find. Let me know if there's anything else I can assist with!
Hi @tkavitha911 , Thank you for reaching out to the Microsoft Community Forum.
Based on your description, I took some sample data and worked out the solution.
Please refer attached .pbix file for reference and share your thoughts.
If this helped solve the issue, please consider marking it “Accept as Solution” so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @tkavitha911 have split the logic into parts by creating intermediate calculated tables, please try this
first create a base weekday table
first table working fine but second table bit confusion about this WeekdayWithRowNumber
Hi @tkavitha911 this will just show row number, for looping purposes, like this
@tkavitha911 , Create measures using
// Calculate the total containers for each day
Total Containers =
VAR PreviousDayPending =
CALCULATE(
SUM('Table'[Pending]),
FILTER('Table', 'Table'[Date] = EARLIER('Table'[Date]) - 1)
)
RETURN
IF(
ISBLANK(PreviousDayPending),
'Table'[No of containers arrived],
PreviousDayPending + 'Table'[No of containers arrived]
)
// Calculate the number of containers delivered each day
No of Containers Delivered =
MIN('Table'[Capacity], 'Table'[Total Containers])
// Calculate the number of containers pending delivery each day
Pending =
'Table'[Total Containers] - 'Table'[No of Containers Delivered]
Create a calculated column for each metric:
Total Containers =
VAR PreviousDayPending =
CALCULATE(
SUM('Table'[Pending]),
FILTER('Table', 'Table'[Date] = EARLIER('Table'[Date]) - 1)
)
RETURN
IF(
ISBLANK(PreviousDayPending),
'Table'[No of containers arrived],
PreviousDayPending + 'Table'[No of containers arrived]
)
No of Containers Delivered =
MIN('Table'[Capacity], 'Table'[Total Containers])
Pending =
'Table'[Total Containers] - 'Table'[No of Containers Delivered]
Proud to be a Super User! |
|
Need calculated table for only week days
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
10 | |
7 |