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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How to create a new calculated row from previous row

Hi,

 

Can you please help me to achieve the below:

 

I have a below table:

C1C2C3C4
zzzzzIndia01/01/2019250
zzzzzIndia01/02/2019676
zzzzzIndia01/03/201933
zzzzzIndia01/04/20190
zzzzzIndia01/05/201945
zzzzzIndia01/06/2019232
zzzzzIndia01/07/2019122
zzzzzIndia01/08/20196
zzzzzIndia01/09/201945
zzzzzIndia01/10/20191334
zzzzzIndia01/11/2019211
zzzzzIndia01/12/201923

 from the above table , i created the matrix table to display the data as:

  JanuaryFebruaryMarchAprilMayJuneJulyAugestSeptemperOctoberNovemberDecember
zzzzzIndia25067633045232122645133421123

 

but I need to display the data as below:

 

  JanuaryFebruaryMarchAprilMayJuneJulyAugestSeptemperOctoberNovemberDecember
zzzzzIndia25067633045232122645133421123
zzzzzIndia25092670933452773541285113791334211

 

2nd row is the calculated row. if Jan month I need the same data, if Feb then I need the sum of Jan+Feb data. like for all columns. (Previous month + current month)

 

can anyone help me to achieve this please?

 

 

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could also try this simple measure

Measure = CALCULATE(SUM('Table'[C4]),DATEADD('Table'[C3].[Date],-1,MONTH))+SUM('Table'[C4])

Then drag it into matrix visual and set "show on rows"

4.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You could also try this simple measure

Measure = CALCULATE(SUM('Table'[C4]),DATEADD('Table'[C3].[Date],-1,MONTH))+SUM('Table'[C4])

Then drag it into matrix visual and set "show on rows"

4.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Lin,

 

Thank you so much for your solutions. I checked the file you attached and its working as I expected.

I tried to apply the same logic in my original file and not getting the expected output. I am getting the sum of current month data instead of prev month + current month. for example, Jan month data is 200 and  Feb  is 250 then I am getting 500 instead 450.

I couldn't able to attach my file here. I checked all the settings in your file and compared with me but I couldn't get what is the issue. can you help me on this pease?

 

 

 

Anonymous
Not applicable

Its working fine now. Thank you.

amitchandak
Super User
Super User

You need to create a measure this month + last month

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date Filer])) 
PMTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date Filer],-1,month))) 

New Sales = MTD Sales +PMTD Sales

 

Add this to your matrix table

 

In the matrix table. We have a property under values - Show on rows - Switch that on. You will get a similar display with measure name.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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
Anonymous
Not applicable

I am new to this, can you please explain what is 

'Date'[Date Filer]

 its any table column  or a pre difined function please? in my table C3 is a date column, how to refer it here ?

This my date dimension date and date column is named as date filter.

 

In case you do not have date dimension, please create one and join with your date in the table

https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors