Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
muhitdinfa1
Frequent Visitor

Opening & Ending Balances For Selected Periods

Although it sounds simple, yet I am not able to have the correct values in my table.

I have tested different approcahes such as:

 

CB Option 1 =CLOSINGBALANCEMONTH(SUM('Table1'[Amount]),'Table1'[Date])   => NOT Returning Correct Ending Balance

CB Option 2 =CLOSINGBALANCEMONTH(SUM('Table1'[Amount]),'DimDate'[Date])   => Returning Correct Ending Balance

CB Option 3 =CALCULATE(Sum('Table'[AMOUNT]),LASTDATE('DimDate'[Date])=> Returning Correct Ending Balance
 
For CB Options 2 and 3, it is working if I am selecting the date range including January.
muhitdinfa1_0-1618588622342.png

 

However, when I am unselecting January from the filter, Beginning Balance is returing only zeros.
OB Option 1 = OPENINGBALANCEMONTH(SUM('Table1'[Amount]),'DimDate'[Date])

OB Option 2 = [CB] -CALCULATE(SUM(Table1[Amount]),ALL(Table1[Date]))

muhitdinfa1_1-1618589077544.png

 

Also, since my latest selected month is June, I would expect my Ending Balance to remain the same no matter what I am adding/removing prior to that latest month, but it is changing when I am selecting/unselecting anything prior to June. But with CB Option 1 which is not returing the correct amount, the Ending Balance is remaining as expected although with wrong value.

Any help would be appreciated!

3 REPLIES 3
amitchandak
Super User
Super User

@muhitdinfa1 , All-time intelligence function works best with a date table , because it need continuous dates.

 

OPENINGBALANCEMONTH is CLOSINGBALANCEMONTH of last month

 

CLOSINGBALANCEMONTH looks for the only end of the month date. but lastdate can last available date.

 

If this does not help

Can you share sample data and sample output in table format?

 

refer if these can help

https://www.youtube.com/watch?v=yPQ9UV37LOU

https://www.youtube.com/watch?v=6lzYOXI5wfo

@amitchandak Thank you, but it is not quite helpful. Here's the sample data snapshot. Sometimes, I want to be able to filter by initials in a slicer filter. Unfortunately, it's not allwoing me to paste the values here.

muhitdinfa1_0-1618817094870.png

muhitdinfa1_0-1618817144560.png

 

 



 

HI @muhitdinfa1,

I'd like to suggest you use the date function to manually define the filter ranges on your table records if you want to achieve some advanced operations.

Time Intelligence "The Hard Way" (TITHW)  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.