Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Please provide the Closing balance DAX measure
Posting date date type
Material code type text
Quantity Int64.type
Amount Int64.type
Movement type Int64.type
Solved! Go to Solution.
Closing Balance :=
CALCULATE(
SUM(Inventory[Quantity]),
FILTER(
ALL(Calendar),
Calendar[Date] <= MAX(Calendar[Date])
)
)
This works for Daily, Monthly, Quarterly, and Yearly because the MAX(Calendar[Date]) changes based on the visual’s granularity.
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
Daily Closing Balance =
CALCULATE(
SUM('Inventory'[Quantity]),
FILTER(
ALL('Calendar'),
'Calendar'[Date] <= MAX('Calendar'[Date])
)
)
Monthly Closing Balance =
CLOSINGBALANCEMONTH(SUM('Inventory'[Quantity]), 'Calendar'[Date])
Quarterly Closing Balance =
CLOSINGBALANCEQUARTER(SUM('Inventory'[Quantity]), 'Calendar'[Date])
Yearly Closing Balance =
CLOSINGBALANCEYEAR(SUM('Inventory'[Quantity]), 'Calendar'[Date])
If this answer helped, please click Kudos or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
1.
Daily Closing Balance =
CALCULATE (
SUM ( 'Inventory'[Quantity] ),
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
2.
Monthly Closing Balance =
VAR _LastDay =
EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
RETURN
CALCULATE (
[Daily Closing Balance],
'Calendar'[Date] = _LastDay
)
3.
Quarterly Closing Balance =
VAR _LastDayQuarter =
ENDOFQUARTER ( 'Calendar'[Date] )
RETURN
CALCULATE (
[Daily Closing Balance],
'Calendar'[Date] = _LastDayQuarter
)
4.
Yearly Closing Balance =
VAR _LastDayYear =
ENDOFYEAR ( 'Calendar'[Date] )
RETURN
CALCULATE (
[Daily Closing Balance],
'Calendar'[Date] = _LastDayYear
)
hi @ARUN_DESHPANDE ,
try below:
Closing Balance KeepFilters =
VAR LastDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
SUM('Inventory Transaction'[Quantity]),
KEEPFILTERS('Inventory Transaction'[Posting date] <= LastDate)
)Closing Balance CalcTable =
VAR LastDate = MAX('Calendar'[Date])
VAR FilteredTransactions =
CALCULATETABLE(
'Inventory Transaction',
'Inventory Transaction'[Posting date] <= LastDate
)
RETURN
SUMX(FilteredTransactions, [Quantity])If it doesnt work, please provide more information on input/output.
Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
Hi @ARUN_DESHPANDE ,
May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.
Thank you.
Hi @ARUN_DESHPANDE ,
Thank you @Kedar_Pande , @Arul , @Praful_Potphode , @wardy912 for your inputs.
I just wanted to check if the issue has been resolved on your end, or if you require any further assistance. Please feel free to let us know, we’re happy to help!
Thank you
Chaithra E.
hi @ARUN_DESHPANDE ,
try below:
Closing Balance KeepFilters =
VAR LastDate = MAX('Calendar'[Date])
RETURN
CALCULATE(
SUM('Inventory Transaction'[Quantity]),
KEEPFILTERS('Inventory Transaction'[Posting date] <= LastDate)
)Closing Balance CalcTable =
VAR LastDate = MAX('Calendar'[Date])
VAR FilteredTransactions =
CALCULATETABLE(
'Inventory Transaction',
'Inventory Transaction'[Posting date] <= LastDate
)
RETURN
SUMX(FilteredTransactions, [Quantity])If it doesnt work, please provide more information on input/output.
Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
1.
Daily Closing Balance =
CALCULATE (
SUM ( 'Inventory'[Quantity] ),
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
2.
Monthly Closing Balance =
VAR _LastDay =
EOMONTH ( MAX ( 'Calendar'[Date] ), 0 )
RETURN
CALCULATE (
[Daily Closing Balance],
'Calendar'[Date] = _LastDay
)
3.
Quarterly Closing Balance =
VAR _LastDayQuarter =
ENDOFQUARTER ( 'Calendar'[Date] )
RETURN
CALCULATE (
[Daily Closing Balance],
'Calendar'[Date] = _LastDayQuarter
)
4.
Yearly Closing Balance =
VAR _LastDayYear =
ENDOFYEAR ( 'Calendar'[Date] )
RETURN
CALCULATE (
[Daily Closing Balance],
'Calendar'[Date] = _LastDayYear
)
Daily Closing Balance =
CALCULATE(
SUM('Inventory'[Quantity]),
FILTER(
ALL('Calendar'),
'Calendar'[Date] <= MAX('Calendar'[Date])
)
)
Monthly Closing Balance =
CLOSINGBALANCEMONTH(SUM('Inventory'[Quantity]), 'Calendar'[Date])
Quarterly Closing Balance =
CLOSINGBALANCEQUARTER(SUM('Inventory'[Quantity]), 'Calendar'[Date])
Yearly Closing Balance =
CLOSINGBALANCEYEAR(SUM('Inventory'[Quantity]), 'Calendar'[Date])
If this answer helped, please click Kudos or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
Closing Balance :=
CALCULATE(
SUM(Inventory[Quantity]),
FILTER(
ALL(Calendar),
Calendar[Date] <= MAX(Calendar[Date])
)
)
This works for Daily, Monthly, Quarterly, and Yearly because the MAX(Calendar[Date]) changes based on the visual’s granularity.
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 13 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 25 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |