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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Tyron
Frequent Visitor

Comparing rows in same table to verify what value has changed

Hi

I have researched for an answer to this problem but yet to find the right answer.

 

I have a dataset with columns, ID, Date, Development Type, Delivery Term and would like to see what data has change from one week to the next (if Delivery Term has changed to be specific). All data is within a single table.

 

I need to be able to show (using conditional formatting, this part I am okay with) rows in a table that have been updated.

 

Sample Data (visually you can see PRJ003 has had Delivery Term changed, how is the comparison made?)

IDDateDevelopment TypeDelivery Term
PRJ0013/03/2021NewTerm 1
PRJ0023/03/2021ImprovementTerm 2
PRJ0033/03/2021ImprovementTerm 2
PRJ0043/03/2021ImprovementTerm 3
PRJ0053/03/2021NewTerm 4
PRJ0063/03/2021NewTerm 4
PRJ00110/03/2021NewTerm 1
PRJ00210/03/2021ImprovementTerm 2
PRJ00310/03/2021ImprovementTerm 3
PRJ00410/03/2021ImprovementTerm 3
PRJ00510/03/2021NewTerm 4
PRJ00610/03/2021NewTerm 4

 

Thanks and appreciate the assistance

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

This will give you a column of the previous value:

DiffFromPrvWeek = VAR _id = TablePrj[ID]
VAR _term = TablePrj[Delivery Term]
VAR _date = TablePrj[Date]
RETURN
CALCULATE(MIN(TablePrj[Delivery Term]), FILTER(ALL(TablePrj),  TablePrj[ID] = _id && TablePrj[Date] = _date -7))

You can use it to create another column to signal a difference (from delivery term) or use an IF statement within the formula.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hello how about I need to compare recipes from the same table, by different scepters, and material to see if they match by the amount loaded in the components:

arielgerman195_0-1674313551147.png

and put in a column if it matches or not.

HotChilli
Super User
Super User

This will give you a column of the previous value:

DiffFromPrvWeek = VAR _id = TablePrj[ID]
VAR _term = TablePrj[Delivery Term]
VAR _date = TablePrj[Date]
RETURN
CALCULATE(MIN(TablePrj[Delivery Term]), FILTER(ALL(TablePrj),  TablePrj[ID] = _id && TablePrj[Date] = _date -7))

You can use it to create another column to signal a difference (from delivery term) or use an IF statement within the formula.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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