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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Mariollo
Regular Visitor

Log table - how to show what was changed

I have a log table like the white one below.

I would like to add a blue column which will indicate what was changed in previous row (previous LogId for each EntityID).

 

What is the easiest way to do this in PQ?

 

logtable.png

2 REPLIES 2
MAwwad
Super User
Super User

Or using Dax like this :

 

Changed = VAR CurrentRow = MIN(Table[LogId]) RETURN CALCULATE(MIN(Table[LogId]), Table[EntityID] = EARLIER(Table[EntityID]), Table[LogId] < CurrentRow)

MAwwad
Super User
Super User

 

  1. Create a custom column: Right-click on the log table in the Power Query Editor and select "New Source" > "Blank Query". In the new query, go to "Add Column" > "Custom Column", enter a name for the new column, and enter the following formula:

= List.Last(List.Select(List.Sort([EntityID]), each [EntityID] = [EntityID]))
  1. Close & Load the new query to your worksheet. The new custom column will show what was changed in the previous row for each EntityID.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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