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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Adam_8675309
New Member

Compare Snapshot data in one Table

Hello All,

 

I'm new to Power BI, and hoping to get some help on how to write DAX on Snapshot data I have.  I wasn't able to find anything yet, but I very well may be looking at it all wrong.  

 

Daily snapshots for Customer info would be as follows:

 

Customer     Preference     Date

XYZ              Vanilla           12/31/2017

XYZ              Vanilla            01/01/2018

XYZ              Chocolate      01/02/2018

XYZ              Chocolate      01/03/2018

 

There would be hundreds of thousands of rows for differnet cusotmers and dates, but what I would like to do is create a column at where it would compare the rows in the same table (above) and if it matched on Customer Number, Date minus one day (so the previous day/record), and then if the previous 'Preference' was different, it woudl show what the previous value was, else say Same.  Similar to this:

 

Customer     Preference     Date               Previous Preference

XYZ              Vanilla           12/31/2017     Same

XYZ              Vanilla            01/01/2018    Same

XYZ              Chocolate      01/02/2018    Vanilla

XYZ              Chocolate      01/03/2018    Same

 

Is that possible?  

 

Thank you for any help!

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Adam_8675309,

 

You may refer to the following post.

https://community.powerbi.com/t5/Desktop/Checking-if-record-was-the-same-in-previous-month/m-p/34138...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Adam_8675309,

 

You may refer to the following post.

https://community.powerbi.com/t5/Desktop/Checking-if-record-was-the-same-in-previous-month/m-p/34138...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much for your help!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.