Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Matrix by quarters

        Hey guys,   I have the following data table: Stream Start Date Salary Dev Jan 1, 2022 100,000 Sales Mar 3, 2022 120,000 Sales July 1, 2022 100,000 PM Oct 10...
  • Icey's avatar
    Icey
    4 years ago

    Hi Anonymous ,

     

    How about this:

    Calendar = 
    ADDCOLUMNS (
        CALENDARAUTO (),
        "Year", YEAR ( [Date] ),
        "QuarterNum", QUARTER ( [Date] ),
        "Quarter", "Quarter " & QUARTER ( [Date] )
    )
    

     

    Measure = 
    VAR t =
        SUMMARIZE (
            FILTER (
                CROSSJOIN ( 'Calendar', 'Table' ),
                'Calendar'[Date] >= 'Table'[Start Date]
            ),
            [Stream],
            [Year],
            [Quarter],
            [Salary]
        )
    RETURN
        SUMX ( t, [Salary] / 4 )
    

     

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.