Forum Discussion
Pls help this dax calculated column.
| MARKET | Maxof eta | Container count | inbound_capacity | out_containers |
| japan | 01-02-2024 | 2 | 5 | |
| japan | 04-02-2024 | 2 | 5 | |
| japan | 05-02-2024 | 7 | 5 | |
| Korea | 07-02-2024 | 13 | 7 | |
| Korea | 08-02-2024 | 5 | 7 | |
| Korea | 09-02-2024 | 55 | 7 | |
| china | 10-02-2024 | 76 | 6 | |
| china | 11-02-2024 | 98 | 6 | |
| china | 13-02-2024 | 7 | 6 |
calculate each market wise and each day based on inbound capacity container will go out.
if container capacity is 2 and container count is 4 out_containers per day 2 and it will add next day remaining 2 containers,
pls help this dax calculated column
Hi tkavitha911,
Ensure that your table contains the necessary columns with the correct data types. The MARKET column should be in text format, while the Maxof eta (or your actual ETA date column) should be stored as a date. Additionally, the Container count and inbound_capacity columns must be in whole number format to ensure accurate calculations. Properly structuring your data in this way will help avoid errors and ensure smooth data processing in Power BI.
I used the sample data you provided and applied it to my Power BI report to test the calculation logic:
Container Remaining at EOD =
VAR currentMarket = 'Sheet1'[MARKET]
VAR currentDate = 'Sheet1'[Maxof eta]
-- Total containers till this date for the same market
VAR totalContainers =
CALCULATE(
SUM('Sheet1'[Container count]),
FILTER(
'Sheet1',
'Sheet1'[MARKET] = currentMarket &&
'Sheet1'[Maxof eta] <= currentDate
)
)
-- Total outbound capacity till this date for same market
VAR totalCapacity =
CALCULATE(
SUM('Sheet1'[inbound_capacity]),
FILTER(
'Sheet1',
'Sheet1'[MARKET] = currentMarket &&
'Sheet1'[Maxof eta] <= currentDate
)
)
RETURN
MAX(0, totalContainers - totalCapacity)
Glad I could assist! If this answer helped resolve your issue, please mark it as Accept as Solution and give us Kudos to guide others facing the same concern.
Thank you.
10 Replies
- danextianSuper User
Hi tkavitha911
I'm honestly a bit confused by your explanation. Does "container capacity" refer to the inbound capacity? Also, where will the remaining containers be added? Could you kindly provide your expected result using the same dataset you shared, along with a brief explanation of the reasoning behind it?
I don't think this is what you're looking for:
- tkavitha911Helper III
Containers will be dispatched based on inbound capacity. If the number of containers exceeds the inbound capacity, the excess will be scheduled for the next day, and this process will repeat.
- tkavitha911Helper III
Containers will be dispatched based on inbound capacity. If the number of containers exceeds the inbound capacity, the excess will be scheduled for the next day, and this process will repeat.
- tkavitha911Helper III
Hi Team, pls help above dax measure or coulmn
- v-sgandrathiCommunity Support
Hi tkavitha911,
Thank you for the clarification.
I acknowledge danextian response that their request for the expected output and confirmation of inbound capacity was appropriate and well considered.
Based on your follow-up, we understand that:
- Inbound capacity is the max number of containers dispatched per day.
- Any excess containers should roll over to the next day, continuing until cleared.
To proceed with a DAX solution, could you please share the expected out_containers values for your sample data? This will help validate the logic and ensure an accurate implementation.
Thank you.- v-sgandrathiCommunity Support
Hi tkavitha911,
As we did not get a response, may I know if the above reply could clarify your issue, or could you please help confirm if we may help you with anything else?
And if the provided information meets your requirements, you can Accept the solution and also give Kudos on that reply. It helps other users who are searching for this same information and find the information.
Your understanding and patience will be appreciated.