cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Openingbalancemonth vs own calculation difference

Hello,

I'm trying to report on the Opening/Closing Balance by month, but for some reason, my very first Opening Balance (using the OpeningBalanceMonth function is not showing any data).
When I rewrite the measure it does show a number.
Can someone tell me why this is happening?

Measure 1 (using the OpeningBalanceMonth function)

Measure 2 (using own logic)

Below you see the difference between the two measures.
I would expect that the measure 1 (with the use of OpeningBalanceMonth function) would return the exact same thing as measure 2 (with the use of own logic)

Regards,

Kevin

1 ACCEPTED SOLUTION
Community Support

Hi @KevinParijs ,

Approve with @KevinParijs , the Microsoft Docs is  not very clearly, although it returns a scalar value that represents the expression evaluated at the first date of the month in the current context, the real calculate logic of this function is evaluating the specified expression for the date corresponding to the end of the previous month after applying all the filters.

Here is a simple sample:

From the picture, you can see that the opening balance of January 2022 is blank, that is because there is no data of December 2019, the opening balance of January 2022 would be the closing balance of December 2019. And if you continue to view the data of February 2022, you can see the opening balance will be the closing balance of January 2022.

That is why your first measure does not work.

For more details, please refer to:

Best Regards,

Jianbo Li

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

3 REPLIES 3
Community Support

Hi @KevinParijs ,

Approve with @KevinParijs , the Microsoft Docs is  not very clearly, although it returns a scalar value that represents the expression evaluated at the first date of the month in the current context, the real calculate logic of this function is evaluating the specified expression for the date corresponding to the end of the previous month after applying all the filters.

Here is a simple sample:

From the picture, you can see that the opening balance of January 2022 is blank, that is because there is no data of December 2019, the opening balance of January 2022 would be the closing balance of December 2019. And if you continue to view the data of February 2022, you can see the opening balance will be the closing balance of January 2022.

That is why your first measure does not work.

For more details, please refer to:

Best Regards,

Jianbo Li

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

Super User

@KevinParijs , Opening balance return data on the last date of the previous month. So it will not work the same as what you have

Frequent Visitor

Thank you for your response, but the Microsoft Docs is showing the following definition:

"Evaluates the expression at the first date of the month in the current context"

https://docs.microsoft.com/en-us/dax/openingbalancemonth-function-dax

This made me think that by using this function it would evaluate the 1/january/2021.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors