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
I_miss_tableau
Frequent Visitor

How to show only dimension changes

Hi, 

 

I created below crosstab in Power BI:

 Date
NameJanFebMarch
Janaaa
Kateabb
Olabbb
Tomccc
Mikecca
Elleabc
Annbbb
Tedbaa
Frankccc
Wesbaa

 

 

I want to filter out only employees which changed their team during (at least) last month. Date will be dynamic so I want to avoid typing specific date in formula.

I used this formula (I found it in this forum) but it didnt help. 

Team Changes = 
var _CurrentDate=
max('table'[Date])
var _Currenttime=max('table'[Team])
var _Changes=
      CALCULATE(max('table'[Team]),'team'[Date]<_CurrentDate,ALLEXCEPT('table','table'[Employee]))
return
if(hasonevalue('table'[Employee]),if(not ISBLANK(_Changes)&&_Currenttime<>_Changes,
      _Changes & " to "& _Currenttime
   ))
2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

First step: bring your data into usable format by unpivoting

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMU9JRSoTjWJ1oJe/EklSoQBIYgwT9cxB8mFhIfi6QnQzHIDHfzOxUJEGIia45OcgmQlQ65uVhmpiaAuUjnONWlJiXjWFPeGoxqspYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Jan = _t, Feb = _t, March = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Jan", type text}, {"Feb", type text}, {"March", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Attribute", "Value"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Other Columns",each [Attribute],each "1-" & [Attribute] & "-24",Replacer.ReplaceValue,{"Attribute"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Attribute", type date}})
in
    #"Changed Type1"

Then you can use Power Query, or the Visual Calculations feature to highlight changes.

 

lbendlin_0-1711207557847.png

 

View solution in original post

Either upgrade to a version that supports Visual Calculations, or implement the logic in Power Query.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

First step: bring your data into usable format by unpivoting

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMU9JRSoTjWJ1oJe/EklSoQBIYgwT9cxB8mFhIfi6QnQzHIDHfzOxUJEGIia45OcgmQlQ65uVhmpiaAuUjnONWlJiXjWFPeGoxqspYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Jan = _t, Feb = _t, March = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Jan", type text}, {"Feb", type text}, {"March", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name"}, "Attribute", "Value"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Other Columns",each [Attribute],each "1-" & [Attribute] & "-24",Replacer.ReplaceValue,{"Attribute"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value",{{"Attribute", type date}})
in
    #"Changed Type1"

Then you can use Power Query, or the Visual Calculations feature to highlight changes.

 

lbendlin_0-1711207557847.png

 

Thank you but I don't have the same version of PB as you and cannot open your workbook. I tried create the same formula but cannot use PREVIOUS. 

My data has been already unpivoted, pivot was created as visualization. 

Either upgrade to a version that supports Visual Calculations, or implement the logic in Power Query.

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.