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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
PBI5851
Helper V
Helper V

Beginning and Ending balance for every month

Hello. For the below raw data I am trying to maintain a waterfall calculation by providing a beginning and ending balance for month, quarter and year. But not sure how to accomplish it, please can you advise. 

 

Raw data

PersonIDIncomingDateEndDate
John11/10/2021 
John22/10/20212/20/2022
John32/25/20213/15/2021
John43/5/20217/10/2021
John54/5/20214/20/2021
John65/5/2021 
John75/8/2021 
John85/9/20215/12/2021
John96/10/20216/10/2021
John108/10/20219/12/2021
John119/10/2021 
John1211/12/202111/5/2021
John1312/15/202112/30/2021
John141/20/20221/20/2022
John151/25/20222/10/2022
John162/10/2022 
John172/12/20222/15/2022
John182/16/20222/20/2022
John192/20/2022 

 

Expected Monthly crosstab

 20212021202120212021202120212021202120212021202120222022
 JanFebMarAprMayJunJulAugSepOctNovDecJanFeb
Begin balance01333554555556
Incoming12113101101124
Cancelled00111110101114
End Balance13335545555566

 

Expected Quarterly tab

 20212021202120212022
 Q1Q2Q3Q4Q1
Begin balance03555
Incoming45226
Cancelled13225
End Balance35556

 

Expected Yearly tab

 20212022
Begin balance05
Incoming136
Cancelled85
End Balance56

 

any recommendations please. 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @PBI5851 ,


Based on your description, I created a sample pbix for your reference:

Vlianlmsft_0-1645421240763.png

 


Best Regards,
Liang
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
PBI5851
Helper V
Helper V

found the solution.. 

SWITCH(TRUE(),
ISFILTERED(Datetable[Year Month]),LASTDATE(PREVIOUSMONTH(Datetable[Date])),
ISFILTERED(Datetable[Year Qtr]),LASTDATE(PREVIOUSQUARTER(Datetable[Date])),
ISFILTERED(Datetable[Year]),LASTDATE(PREVIOUSYEAR(Datetable[Date])))
PBI5851
Helper V
Helper V

@V-lianl-msft The switch statment is capturing incorrect month end values as below .

For Feb 2019, its shows 1/28, rather than 1/31 and so on. Please advise. 

 

PBI5851_0-1645621086592.png

 

V-lianl-msft
Community Support
Community Support

Hi @PBI5851 ,


Based on your description, I created a sample pbix for your reference:

Vlianlmsft_0-1645421240763.png

 


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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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