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
julesdude
Post Partisan
Post Partisan

How to carry over previous year value into year where value is not updated

Hi all, 

I have a report where I have a bar graph visual. The X-axis is Year and Y-axis is value. It is driven from TableA in my model:

 

TableA

ReferenceValueDate
aaa8015/04/2022
aaa2024/07/2022
aaa4620/02/2020
aaa8402/09/2020
aaa23501/04/2018
aaa6901/02/2018
aaa2501/02/2017
aaa2421/10/2014
bbb7530/12/2021
bbb9528/11/2020
bbb1120/07/2018
bbb6616/07/2017
bbb8412/05/2016
bbb6401/02/2015
bbb9008/06/2014
bbb3602/04/2013

 

As things stand today, the date is December 2022. I want to display the SUM of values split by year. The problem in my current bar chart is that each time a year starts, the sum for that year starts at zero. Also, previous years contain gaps where the value against a reference may not be declared in a year - so it is not carried over a year or two where there is no value update/change. So if I'm looking at 2023's total values on the 1st January 2023, 2023 will have a value of zero as it's a new year and no values with a date in that year have been made.

What I need is for values to carry through the years. In the case of Reference aaa in TableA above, the last value of the reference in 2018 was on 01/04/2018 for 235. I would want that 235 to be part of the amount summed for the year 2018, to also be summed for 2019 but not 2020 as in that year there are two reviews of the value. The latest value of 84 would then take priority for 2020

There's also a cross check needed with TableB to see whether the reference was actually purchased or sold. If it has been sold and the date of being sold was, say, in 2020, then you'd not want to carry the value of that reference into 2021:

TableB

ReferencePurchase Transaction Date
aaaPurchase 01/01/2013
bbbPurchase 01/04/2013
cccSale28/07/2022
dddSale22/06/2022

 

How do I achieve this? Grateful for any help.

46 REPLIES 46
scee07
Resolver I
Resolver I

OK, understood. The approach above is then not working. One question: the transcaction date above is then the date somebody does some update for a certain reference number? If this is the case I will try do some measures to solve this. But presumably it wil be tomorrow as I am busy today.

Hi Christian @scee07 

Yes that is correct. The transaction date is the date when the value of the reference is updated. 

No problem as you are busy. I just thank you for your time on this. 

Anonymous
Not applicable

Hi @julesdude,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

scee07
Resolver I
Resolver I

Hi, I will try to sketch my approach, hope this helps:

a) I assume that you want to create a base table in Power BI and then just apply the visual and this should give the right amounts per year in your bar chart.

b) the strategy will be to do create  an additional table to join them together (call it "carry over table") and then do result = UNION(Table A, "carry over table") and apply the visual

 

- create a work table temp = TableA

- esablish a key relationship between temp and TableB via reference

- in temp create a new column  purchaseRef = RELATED (TableB['Purchase']) this gives the information of TableB if to carry over or not.

- in temp create a new column: 

newDate = 
var transactionYear = year(temp['Transaction Date'])
var thisYear = year(today())
var thisRef = temp['purchaseRef']
return 
if(thisRef = "Purchase" && transactionYear < thisYear, Date(transactionYear + 1, 1, 1)

So, in the helper table the amount is carried over to the first of the next year if the criteria are met.

Final helper table:

carry over table = selectcolumns(filter(temp, isblank([newDate] = false)), 
"Reference", temp['Reference'], 
"Value", temp['Value'], 
"Date", temp['newDate'])

result = UNION(Table A, "carry over table"). You name the result after your visual with "VIEW" or so, to make clear that this is solely attached to the visual.

So, basically artifical records for the visual are created that carry the first of the next year and the amount to carry over. Or your logic goes in the newDate table column of the helper table. 

The alternative is to create a table with the distinct years you have and do a more complicated calculated column to get the right amount per year. Matter of taste.

 

Best regards 

 

Christian

 

Hi Christian @scee07 . Thank you so much for your approach on Friday. Apologies I have been away for a few days until now.

I am not sure if the base table approach will work. Would the base table update each time a user changes a date in the report? I ask because in the report I have a date picker slicer labelled As Of Date the user can select that enables them to go back in time to see what the visualisations would like like in the past. Basically it's a date range slicer but I've covered the start date as this needs to remain fixed. The 'to' date modifies all visuals to provide a point in time. So in the case of TableA above, if I selected a date in 2018 I would only get data displayed in my visualisations up until that point. I have not used a table built by DAX before so I'm not sure if it would update here.
The alternative option with the implementation of calculated column wouldn't work as I know that definitely wouldn't update with change of date.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.