Forum Discussion

stribor45's avatar
stribor45
Post Prodigy
5 months ago
Solved

Organize the data for the fact table

This is kind of what my data looks like. There is just over milions of rows of data that I am trying to move foard in most efficient way. I am trying to capture by perhaps custom columns following data

 

Custom column #1 - Latest  Status for the year of the date

Custom column #2 - Associate season with current year

 

Additionally do I need to keep this in same table or does this need to be aplit based on personid and requestid?

This is small sample of the data

 

PersonIDRequestIDDateTypeStatusSeason
1111112345615-Jul-25AAAAASummer
1111112345622-Aug-25BBBBBSummer
1111112345611-Feb-26BCCCCWinter
1111123232315-Jul-25DAAAASummer
1111123232320-Dec-25FBBBBWinter
2222265432117-Aug-25CAAAASummer
2222265432122-Sep-25CBBBBFall
2222265432117-Jan-26CCCCCWinter

 

  • Hi stribor45 
    Thank you for reaching out to the Microsoft Fabric community forum.
     

    When working with a dataset containing millions of rows, it's best to keep all records within a single fact table. Dividing the data by PersonID or RequestID isn't needed and can reduce performance and make the model more complex.
     

    To find the latest status for each PersonID–RequestID–Year group, start by adding a Year column derived from the Date. Then, use Power Query to group by PersonID, RequestID, and Year, and select the maximum Date. Merge this grouped data back with the original table on PersonID, RequestID, Year, and Date to get the corresponding Status. This approach avoids costly sorting and row-by-row calculations, making it efficient for large datasets.
     

    If Season is determined by the calendar, it's better to calculate it from a Date dimension instead of storing it in the fact table. In summary, keeping a single fact table, calculating “latest” values during data refresh with grouping, and using a Date dimension for time-based fields is the recommended method.
     

    If you have any further questions, feel free to reach out and we'll be glad to assist.

     

    Regards,

    Microsoft Fabric Community Support Team.
     

3 Replies

  • Read about Normalization, and about the difference between a Fact (something you calculate) table and a Dimension (something you filter by) table .  Then design your data model so it fits your business scenario.

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi stribor45 
    Thank you for reaching out to the Microsoft Fabric community forum.
     

    When working with a dataset containing millions of rows, it's best to keep all records within a single fact table. Dividing the data by PersonID or RequestID isn't needed and can reduce performance and make the model more complex.
     

    To find the latest status for each PersonID–RequestID–Year group, start by adding a Year column derived from the Date. Then, use Power Query to group by PersonID, RequestID, and Year, and select the maximum Date. Merge this grouped data back with the original table on PersonID, RequestID, Year, and Date to get the corresponding Status. This approach avoids costly sorting and row-by-row calculations, making it efficient for large datasets.
     

    If Season is determined by the calendar, it's better to calculate it from a Date dimension instead of storing it in the fact table. In summary, keeping a single fact table, calculating “latest” values during data refresh with grouping, and using a Date dimension for time-based fields is the recommended method.
     

    If you have any further questions, feel free to reach out and we'll be glad to assist.

     

    Regards,

    Microsoft Fabric Community Support Team.
     

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi stribor45 

    We would like to confirm whether the issue has been resolved. If it is still outstanding, please share any additional information so we can assist you further.

    Thank you.