Forum Discussion

tvathis's avatar
tvathis
Frequent Visitor
2 years ago
Solved

Changing Monthly to Quarterly

Hi!  I currently have a measure that pulls from # of deliveries from a spreadsheet to match up with the dates in the table.   I would like to change this to quarterly instead.   Is there an easy w...
  • Greg_Deckler's avatar
    2 years ago

    tvathis Maybe:

    Dashboards =
    VAR _A = SUM (charges[RVU Amount] )
    VAR _B = STARTOFMONTH ( 'charges'[begin_date_of_service] )
    VAR _C =
    SWITCH (
    TRUE(),
    _B <= DATE ( 2024, 3, 1 ), SUM ( 'Deliveries'[1/1/2024] ) + SUM ( 'Deliveries'[2/1/2024] ) + SUM ( 'Deliveries'[3/1/2024] ),
    _B <= DATE ( 2024, 6, 1 ), SUM ( 'Deliveries'[4/1/2024] ) + SUM ( 'Deliveries'[5/1/2024] ) + SUM ( 'Deliveries'[6/1/2024] ),
    _B <= DATE ( 2024, 9, 1 ), SUM ( 'Deliveries'[7/1/2024] ) + SUM ( 'Deliveries'[8/1/2024] ) + SUM ( 'Deliveries'[9/1/2024] ),
    SUM ( 'Deliveries'[10/1/2024] ) + SUM ( 'Deliveries'[11/1/2024] ) + SUM ( 'Deliveries'[12/1/2024] )
    )
    RETURN
    DIVIDE ( _A, _C )