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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.