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
shilpa288
Frequent Visitor

Opening Balance not working

Hi Guys,

 

I am having issue with opening balance dax function.

I am using this calculation for opening balanace which is not working correctly.

Open bal =

CALCULATE(
MAX(View_EventRec_Test3[Charges/Required] ),
TOPN(1,
FILTER(
ALLSELECTED(View_EventRec_Test3),
View_EventRec_Test3[InvoiceDate]< Max(View_EventRec_Test3[InvoiceDate])
),
View_EventRec_Test3[InvoiceDate],DESC
))
 
Please find sample report template.

shilpa288_0-1656895911502.png

Kindly help !

Thank you

 

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @shilpa288 ,

 

According to your statement, I think first [OpenBal] is equal to 0 and other [OpenBal]s is calculated based on  [Clos_Bal].  [Clos_Bal] is calculated based on the [Clos_Bal] before. As far as I know , Power BI doesn't support us to calculate looping by Dax. I suggest you to calculate this by M code in Power Query.

List.Generate() should work.  Here is a video about easying looping in Power Query.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @shilpa288 ,

 

According to your statement, I think first [OpenBal] is equal to 0 and other [OpenBal]s is calculated based on  [Clos_Bal].  [Clos_Bal] is calculated based on the [Clos_Bal] before. As far as I know , Power BI doesn't support us to calculate looping by Dax. I suggest you to calculate this by M code in Power Query.

List.Generate() should work.  Here is a video about easying looping in Power Query.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi RicoZhou, 

 

Thank you for your reply. 
Yes, DAX doesn't support and I used Power query to do this . 
Thank you for your help . 

shilpa288
Frequent Visitor

Hi , Is there any way to achive this using Dax?

 

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.