Forum Discussion

igaca's avatar
igaca
Icon for Helper III rankHelper III
9 years ago
Solved

Efficiently Comparing Single Fact Table Subsets to one Another Using DAX

  Often times I run into a scenario where I am working with multiple schedules data sets and need to draw comparisons between them to review progress, over time.   To facilitate this, I typically ...
  • v-sihou-msft's avatar
    8 years ago

    igaca

     

    In my opinion, I prefer the approach that merge all files into one fact table. So your table will have file as highest grain, then multiple activities group on file level. There might be data for same activity in multiple files. 

     

    In this scenario, you can create a measure to get the max date of all dates before current schedule start date and group on Activity level. Then you can have current StartDate minus LastStartDate measure to get the Slippage. 

     

    Slippage =
    1
        * (
            CALCULATE ( MAX ( Table[StartDate] ), ALLEXCEPT ( Table, Table[ActivityId] ) )
                - CALCULATE (
                    MAX ( Table[StartDate] ),
                    FILTER ( Table, Table[StartDate] < MAX ( Table[StartDate] ) ),
                    ALLEXCEPT ( Table, Table[ActivityId] )
                )
        )

    Regards,