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
jamuka
Advocate II
Advocate II

How to create Type 2 SCD table for price tracking

hello all,

 

I have a file that shows my purchase price on store level and daily basis , which includes a lot of duplicates because of the day stamp. 

I want to to turn it a new table so I can reduce my file size, current file have over 9 milllion rows. But I couldn't find a solution in power query how to get data from next row.

 

below you can see my current file and desired result.

 

kind regards

 

current data filecurrent data file

 

desired resultdesired result

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Use summarize

 

Group on the store , product and purchase and take min and mac for date

 

SUMMARIZE(Price,Price[Store],Price[Product],Price[Price],"Min date",Min(Price[Date]),"Max date",Max(Price[Date]))

Refer

https://community.powerbi.com/t5/forums/replypage/board-id/power-bi-designer/message-id/424476

https://community.powerbi.com/t5/Desktop/Creating-a-summary-table-out-of-existing-table-assistance/t...

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Use summarize

 

Group on the store , product and purchase and take min and mac for date

 

SUMMARIZE(Price,Price[Store],Price[Product],Price[Price],"Min date",Min(Price[Date]),"Max date",Max(Price[Date]))

Refer

https://community.powerbi.com/t5/forums/replypage/board-id/power-bi-designer/message-id/424476

https://community.powerbi.com/t5/Desktop/Creating-a-summary-table-out-of-existing-table-assistance/t...

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Hello @amitchandak,

 

it works thanks, I didn't thought I can use summarize or group by in Query Editor.

 

have a nice day

You can apply logic when Min date and max date is null make max date as null

hello @amitchandak,

 

sorry but I don't understand your solution. Each product have Min date, there's no data which don't have a min date.

 

regards

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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