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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Twizxup
Frequent Visitor

Calculating Changes in Cumulative/Appended Report

Hi All,

 

I receive a report every week that consists of our company's current cost centers and, each week, I append it to the previous week's report. My ultimate goal is to only return a list of changes that have taken place (then/now). Below is a sample dataset of the appended reports (my source data).

Report DateCost Center CodeCost Center NameCost Center DivisionCost Center DepartmentCost Center Owner
1/1/2025123Financial Planning1FinanceFinancial PlanningJanet
1/1/2025234Compliance1Human ResourcesComplianceEd
1/1/2025345Customer Sales Analysis1SalesCustomer Sales AnalysisMadison
1/1/2025456Data Analytics1Chief Operating OfficeData AnalyticsMitch
1/1/2025567Corporate Finance1FinanceCorporate FinanceChris
1/8/2025123Financial Planning1FinanceFinancial PlanningJanet
1/8/2025234Compliance1Human ResourcesComplianceEd
1/8/2025345Customer Sales Analysis2SalesCustomer Sales AnalysisMadison
1/8/2025456Data Analytics1Chief Operating OfficeData AnalyticsLuka
1/15/2025123Financial Planning1FinanceFinancial PlanningJanet
1/15/2025234Compliance1Human ResourcesComplianceEd
1/15/2025345Customer Sales Analysis2SalesCustomer Sales AnalysisMadison
1/15/2025456Data Analytics1Chief Operating OfficeData AnalyticsLuka
1/15/2025678Taxes1FinanceTaxesAdam

 

Using this data, I'd like to return a table that captures only the week-to-week changes, including cost centers that have been added or removed. An example of the desired output is below.. please note that the green font represents the values that changed, and the "Explanation" field with orange font is just a helper field to explain what changed (although I also want to create this calculated field, which I believe should be pretty easy).

Cost Center CodeThen/NowReport DateCost Center NameCost Center DivisionCost Center DepartmentCost Center OwnerExplanation
345Then1/1/2025Customer Sales Analysis1SalesCustomer Sales AnalysisMadisonCost Center Name Change
345Now1/8/2025Customer Sales Analysis2SalesCustomer Sales AnalysisMadisonCost Center Name Change
456Then1/1/2025Data Analytics1Chief Operating OfficeData AnalyticsMitchCost Center Owner Change
456Now1/8/2025Data Analytics1Chief Operating OfficeData AnalyticsLukaCost Center Owner Change
567Then1/1/2025Corporate Finance1FinanceCorporate FinanceChrisCost Center Removed
567Now1/8/2025    Cost Center Removed
678Then1/8/2025    Cost Center Added
678Now1/15/2025Taxes1FinanceTaxesAdamCost Center Added

 

Any help would be hugely appreciated! Thank you in advance!

6 REPLIES 6
v-shamiliv
Community Support
Community Support

Hi @Twizxup 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-shamiliv
Community Support
Community Support

Hi @Twizxup 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-shamiliv
Community Support
Community Support

Hi @Twizxup 
Thank you for reaching out microsoft fabric community forum.

you're right that the current logic only captures the first change, which isn't ideal when multiple fields can change at once.

The good news is, you don’t need to hardcode every combination. Instead, you can create a dynamic DAX expression that checks each field for changes and then combines any differences into a single "Change Type" field like:

“Cost Center Name Change + Cost Center Owner Change”

This way, it picks up all changes automatically, no matter how many fields you’re tracking. And if you prefer to list each change on a separate row (one per field), that’s also possible.


If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community
Thank you.


rajendraongole1
Super User
Super User

Hi @Twizxup  - create a calculated column in your table to get the previous report date for each Cost Center.

 

Previous Report Date =
VAR CurrentDate = 'CostCenters'[Report Date]
VAR CostCenter = 'CostCenters'[Cost Center Code]
RETURN
MAXX(
FILTER(
'CostCenters',
'CostCenters'[Cost Center Code] = CostCenter &&
'CostCenters'[Report Date] < CurrentDate
),
'CostCenters'[Report Date]
)

 

let's create a calculated table to identify changes between weeks

 

ChangesTable =
VAR CurrentData = 'CostCenters'
VAR PreviousData =
ADDCOLUMNS(
CurrentData,
"Previous Report Date",
[Previous Report Date],
"Previous Cost Center Name",
LOOKUPVALUE('CostCenters'[Cost Center Name], 'CostCenters'[Cost Center Code], 'CostCenters'[Cost Center Code], 'CostCenters'[Report Date], [Previous Report Date]),
"Previous Cost Center Owner",
LOOKUPVALUE('CostCenters'[Cost Center Owner], 'CostCenters'[Cost Center Code], 'CostCenters'[Cost Center Code], 'CostCenters'[Report Date], [Previous Report Date])
)

RETURN
FILTER(
ADDCOLUMNS(
PreviousData,
"Change Type",
SWITCH(
TRUE(),
ISBLANK([Previous Report Date]), "Cost Center Added",
ISBLANK([Cost Center Name]) && ISBLANK([Cost Center Owner]), "Cost Center Removed",
[Previous Cost Center Name] <> [Cost Center Name], "Cost Center Name Change",
[Previous Cost Center Owner] <> [Cost Center Owner], "Cost Center Owner Change",
BLANK()
)
),
NOT(ISBLANK([Change Type]))
)

 

Hope now ,you can then display this table in Power BI and apply conditional formatting to highlight changes.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





This is great and hugely helpful! The only problem is (and I should have included this scenario in the example):

 

When there are multiple changes to the same cost center simultaneously, only the first change in the logic is captured. For example, if both the Cost Center Name and Cost Center Owner changes for cost center 345, the Change Type field only captures "Cost Center Name Change" as that is the first item in the logic..

 

Is there any way to append these values automatically so that the Change Type field says something like "Cost Center Name Change + Cost Center Owner Change"

 

I understand I could manually code this like:

[Previous Cost Center Name] <> [Cost Center Name] && [Previous Cost Center Owner] <> [Cost Center Owner], "Cost Center Name Change + Cost Center Owner Change"

 

The problem with this, though, is that the data I provided is only a sample, and the actual number of fields I need to track changes for is 9. So, that would require about 400 million possible combinations (9^9) which is obviously infeasible.

 

Thank you again for getting me this far, and if you have any advice on this, I would reaaaally appreciate it! 

@rajendraongole1 Just following up on this to see if you know of a solution/workaround to handle multiple changes (a cost center could experience one change (ex: Cost Center Name), or it could experience multiple changes simultaneously (ex: Cost Center Name, Cost Center Division, & Cost Center Owner))..

 

Correction to my earlier statement: With 9 fields subject to change, I believe there are ~363,000 different combinations (excluding repetitions) which, still, makes it unrealistic to code.

 

Instead, is there a way to append the 'Change' values as I mentioned before or, if it would be easier, would it be possible to have the code continue to execute after a change is identified, and put each change on a separate line? For example:

 

Cost Center CodeChange Type
345Cost Center Name Change
345Cost Center Owner Change
345Cost Center Division Change

 

Thanks again!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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