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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Checking if a Column Changed from Last Month to This Month

Good day,

I am trying to see if there is a function that I can use to track if the record of same account number had changed over time. I am looking if I can add an extra column and if there is a change says "Yes" and if there is non says "No". the record of the time has more months, but I had filter the months into the first two months.

 

Below is an example of my matrix table. 

Account NumberThe End of Last MonthToday
1IncreaseIncrease
2Decrease 
3Non ChangeNon Change

*There is a possibility of blank if the account is close.

 

Appreciate for any help.

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Here is one way

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLMSy5KTSxOxclUitWJVjICMlxS4WKJSckgGaikMZDhl5+n4JyRmJeeis4Bq4oFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account Number" = _t, #"The End of Last Month" = _t, Today = _t, ColA = _t, ColB = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Account Number", "The End of Last Month", "Today", "ColA", "ColB"}),
    #"Added Custom" = Table.AddColumn(#"Replaced Value", "Change", each [a = List.RemoveNulls(List.Skip(Record.ToList(_))),
 b = if List.MatchesAll(a, each _=a{0}) then "Yes" else "No"][b])
in
    #"Added Custom"

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

Here is one way

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLMSy5KTSxOxclUitWJVjICMlxS4WKJSckgGaikMZDhl5+n4JyRmJeeis4Bq4oFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account Number" = _t, #"The End of Last Month" = _t, Today = _t, ColA = _t, ColB = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Account Number", "The End of Last Month", "Today", "ColA", "ColB"}),
    #"Added Custom" = Table.AddColumn(#"Replaced Value", "Change", each [a = List.RemoveNulls(List.Skip(Record.ToList(_))),
 b = if List.MatchesAll(a, each _=a{0}) then "Yes" else "No"][b])
in
    #"Added Custom"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.