Skip to main content
cancel
Showing results for 
Search instead 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

Reply
MaheshMk
Frequent Visitor

opening balance issue

Hi folks, 

 

I've a challenge with Opening Balance 🙂 It works well for the first couple of rows but doesn't afterwards. Please help. 

 

Sure, I'm missing a trick here. 

 

Thanks, 
Mahesh

PBI OPBAL Issue.png

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @MaheshMk 

 

You can use the below pattern.

previousMonthRR = 
VAR _lpd = CALCULATE(
    LASTDATE( 'Calendar'[Date] ),
    PARALLELPERIOD( 'Calendar'[Date], -1, MONTH )
) 
RETURN CALCULATE( 
    SUM( Table[Added] ) - SUM( Table[Sold] ) + SUM( Table[Returned] )
    'Calendar'[Date] <= _lpd 
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @MaheshMk ,

Have you solved the problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share your data sample as table format and your desired output so that we could help further on it.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Mariusz
Community Champion
Community Champion

Hi @MaheshMk 

 

You can use the below pattern.

previousMonthRR = 
VAR _lpd = CALCULATE(
    LASTDATE( 'Calendar'[Date] ),
    PARALLELPERIOD( 'Calendar'[Date], -1, MONTH )
) 
RETURN CALCULATE( 
    SUM( Table[Added] ) - SUM( Table[Sold] ) + SUM( Table[Returned] )
    'Calendar'[Date] <= _lpd 
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Helpful resources

Announcements
Europe Fabric Conference

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 Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.