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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ReutAtias12
Frequent Visitor

end / start balance based of mesures

I created a matrix in which each row is based on mesure 

  Q1Q2Q3Q4
sales rep namestart balance 01250175012750
 new business 1000 5000 
 up -sell 2505006000 
 churn     
 end balance 1250175012750

12750

 

the start balance is supposed to be the end balance from the last quarter

and the end balance is supposed to be the total of all the measures in the same quarter 

 

 

Start Balance = 
IF(CALCULATE([Total Targets], PREVIOUSQUARTER(dimDates[Date])) = 0 , 
0,
 CALCULATE([End Balance], PREVIOUSQUARTER(dimDates[Date])))
End Balance = 
var _cyc = [New Business] + [UP - Sell] + [ Churn]
var _cycLQ = CALCULATE([New Business] + [UP - Sell] + [ Churn],PREVIOUSQUARTER(dimDates[Date]))
return 
IF(CALCULATE([Total Targets],PREVIOUSQUARTER(dimDates[Date])) = 0,
_cyc,
[Start Balance] +_cyc)

 

 

the end balance is not working (I can't use the [start balance] in the [end balance]) 

how can I fix that? 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ReutAtias12 , to me it seems like a case of cumulative measure

 

beginning

calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]< Min(Date[Date])))

 

End

calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]<= max(Date[Date])))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @ReutAtias12 

According to your description, you want to calculate the sum of the measures in row headers?

If this , you can refer to this:
(1)This is my test data:

vyueyunzhmsft_0-1672716614302.png

(2)I create two measures to test:

vyueyunzhmsft_1-1672716646527.png

vyueyunzhmsft_2-1672716652609.png

(3)Then we need to create  a dimension table to put on the Matrix visual:

vyueyunzhmsft_3-1672716681138.png

(4)Then we need to create a measure like this:

Value = var _row = MAX('Row'[Column1])
return
SWITCH(_row,
"Start Balance" , [Start Balance] , 
"Test Sum" , [Test Sum],
"Total" , [Start Balance]+ [Test Sum]
)

(5)Then we can pot the fields we need on the Matix visual and we can meet your need:

vyueyunzhmsft_4-1672716724797.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

amitchandak
Super User
Super User

@ReutAtias12 , to me it seems like a case of cumulative measure

 

beginning

calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]< Min(Date[Date])))

 

End

calculate( [New Business] + [UP - Sell] + [ Churn], filter(all(Date), Date[Date]<= max(Date[Date])))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

can my start point for the cumulative calculation be only after [total targets] on the PREVIOUS QUARTER = 0

CALCULATE([Total Targets], PREVIOUSQUARTER(dimDates[Date])) = 0

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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