Forum Discussion

rajasekaro's avatar
rajasekaro
Icon for Helper III rankHelper III
1 year ago
Solved

Stock opening closing calculation

DOCDATE ITEMID QTY PLUSORMINUS BRANCHID LOCID STOCKVALUE 24-11-2024 ITEM001 35 p BRANCH3 LOC2 1247.4 16-09-2024 ITEM010 25 m BRANCH3 LOC2 1422.41 26-07-2024 ITEM011 64...
  • v-pnaroju-msft's avatar
    1 year ago

    Thankyou, Akash_Varuna, for your response.

    Hi rajasekaro,

    We appreciate your question on the Microsoft Fabric Community Forum.

    Please follow these steps to solve the issue:

    1. Load the data using Power BI’s "Enter Data" option or Excel.
    2. Create a Date Table using the CALENDAR function and connect it to the DOCDATE field.
    3. Use these measures:
      a.Opening Qty: sums the quantity before the selected date using ALL().
      b.Received Qty: includes only the entries with "p" values.
      c.Issued Qty: includes only the entries with "m" values.
      d.Closing Qty = Opening + Received – Issued.

    This method will work smoothly with slicers and give correct, dynamic results for any date you select.

    We have attached a screenshot and a sample pbix file for your reference:

    If our answer helps you, please mark it as the accepted solution and give kudos. This will help other community members with similar questions.

    If you have any more questions, please feel free to contact the Microsoft Fabric community.

    Thank you.