Forum Discussion

odl001's avatar
odl001
Advocate II
1 year ago
Solved

Current and Previous Cycle Count Based on Overlapping Cycles

This has been buggling my brain for the past few days. I have the following model, with a single fact table. The Offer Cycle and Offer Cycle Comparison dimension tables are basically just a l...
  • MattiaFratello's avatar
    MattiaFratello
    1 year ago
    Summarized Applicant Count - Previous Period =
    CALCULATE(
        DISTINCTCOUNT(CombinedFacts[Applicant ID]),
        FILTER(
            ALL(CombinedFacts),
            CombinedFacts[Phase Count Flag] = 1 &&
            CombinedFacts[days_in_cycle] = MAX(CombinedFacts[days_in_cycle]) &&
            CombinedFacts[reporting_date] = 
                CALCULATE(
                    MAX(CombinedFacts[reporting_date]),
                    FILTER(
                        ALL(CombinedFacts),
                        CombinedFacts[reporting_date] < MAX(CombinedFacts[reporting_date]) &&
                        CombinedFacts[days_in_cycle] = MAX(CombinedFacts[days_in_cycle])
                    )
                )
        )
    )