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
Anonymous
Not applicable

Capture price changes

Hi,

I have below data, I would like to capture the changes of the price for each Part No:

 

2020-09-17_23-41-06.png

 

I would like the result to be like below, capture the price whenever it changes:

2020-09-17_23-45-10.png

can someone help please?

 

10 REPLIES 10
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

you can do this by a easy function:

02.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

@v-diye-msft is Ealiest Date a calculated column? can you please share the DAX.

 

Hi @Anonymous 

 

I didn't write DAX, just change the aggreate type of date column, you'll make it.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

@v-diye-msft thanks , I will try it.

Anonymous
Not applicable

@v-diye-msft , below 2 tables are the row data in table 1 and aggregated in table 2 for a particulare part number, it gives the correct unique price, but the earliest dates in table 2 are wrong, it looks like it is getting the earliest date regardless of the part number.

Also can you please advise how can I add the sum of the distinct prices, for below example the total sum is 31.23

 

2020-09-23_9-36-43.png

Ashish_Mathur
Super User
Super User

Hi,

One way could be that in the Query Editor, you may select all columns and then right click > Remove Duplicates.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur , my report is connected to the tabular model, I can't use query editor.

Thanks for your comment anyway.

Fowmy
Super User
Super User

@Anonymous 

Can you try this  as a new column to your table and check

Column = 

VAR _PRICE = MAXX(FILTER('Table', 'Table'[Part No] = EARLIER('Table'[Part No]) && 'Table'[Date] < EARLIER('Table'[Date])), 'Table'[Pirce])
VAR _PART= MAXX(FILTER('Table', 'Table'[Part No] = EARLIER('Table'[Part No]) && 'Table'[Date] < EARLIER('Table'[Date])), 'Table'[Part No])
VAR CP = [Pirce]

RETURN

IF(           
    [Part No] = _PART ||( _PART=BLANK() && _PART <> BLANK()),
    [Pirce] , 
    BLANK() 
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks @Fowmy , my data source is a tabular model, and the source table is very large, around 4 millions record, so I was trying to avoid adding calcualted column.

Is there away to just do it in a measure or measures?

Anonymous
Not applicable

One thing I forgot to menation that date column is from another table, but it is join with the part table.

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.