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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Show newest data from frequent updates

Hi everyone,

 

I receive data updates frequently where the latest data get added to a spreadsheet with the previous data updates.  The changes could be in any of the columns.  I want to make sure if something changes for a particular product, that I am pulling in the latest data to my data grid while making sure the data that didn't have any changes remains untouched.  So for product A, for July I want to show the price of $4 but have it go back up to $5 in August.  I also need to be able to take into account if new products get added and if the the Stores change.  I do have a column in the raw data the will indicate if there has been a change.

 

Thanks in advance!

 

 

ProductStoreRegualr PriceDateSales MonthSales Price
AAlbertsons$5.006/1/2022July$4.00
BWalmat$6.006/1/2022  
CTarget$10.006/1/2022July$9.00
DSafeway$4.006/1/2022  
EBakers$25.006/1/2022  
      
ProductStoreRegualr PriceDateSales DateSales Price
AAlbertsons$5.007/1/2022  
BWalmat$6.007/1/2022August$4.00
CTarget$10.007/1/2022  
DSafeway$4.007/1/2022  
EBakers$25.007/1/2022August$19.00
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

 

Measure =
var _maxdate=
MAXX(FILTER(ALL('Table'),'Table'[Product]=MAX('Table'[Product])),[Date])
var _mindate1=
DATE(YEAR(_maxdate),MONTH(_maxdate)-1,DAY(_maxdate))
return
SWITCH(
    TRUE(),
_mindate1=MAX('Table'[Date])&&MAX('Table'[Product])in{"A","C"},MAX('Table'[Regualr Price])-1,
_maxdate=MAX('Table'[Date])&&MAX('Table'[Product]) ="A",MAX('Table'[Regualr Price]),
_maxdate=MAX('Table'[Date])&&MAX('Table'[Product])="B",MAX('Table'[Regualr Price])-2,
_maxdate=MAX('Table'[Date])&&MAX('Table'[Product])="E",
CALCULATE(SUM('Table'[Regualr Price]),FILTER(ALL('Table'),'Table'[Date]=_maxdate&&'Table'[Product]="E"))
-
CALCULATE(SUM('Table'[Regualr Price]),FILTER(ALL('Table'),'Table'[Date]=_maxdate&&'Table'[Product]="B"))
,
BLANK())

 

2. Result:

vyangliumsft_0-1655689445636.png

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

 

Measure =
var _maxdate=
MAXX(FILTER(ALL('Table'),'Table'[Product]=MAX('Table'[Product])),[Date])
var _mindate1=
DATE(YEAR(_maxdate),MONTH(_maxdate)-1,DAY(_maxdate))
return
SWITCH(
    TRUE(),
_mindate1=MAX('Table'[Date])&&MAX('Table'[Product])in{"A","C"},MAX('Table'[Regualr Price])-1,
_maxdate=MAX('Table'[Date])&&MAX('Table'[Product]) ="A",MAX('Table'[Regualr Price]),
_maxdate=MAX('Table'[Date])&&MAX('Table'[Product])="B",MAX('Table'[Regualr Price])-2,
_maxdate=MAX('Table'[Date])&&MAX('Table'[Product])="E",
CALCULATE(SUM('Table'[Regualr Price]),FILTER(ALL('Table'),'Table'[Date]=_maxdate&&'Table'[Product]="E"))
-
CALCULATE(SUM('Table'[Regualr Price]),FILTER(ALL('Table'),'Table'[Date]=_maxdate&&'Table'[Product]="B"))
,
BLANK())

 

2. Result:

vyangliumsft_0-1655689445636.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors