Forum Discussion

arp2's avatar
arp2
Helper II
1 year ago
Solved

Custom Fiscal Year error

I have a simple model in Power BI with two tables. I have a custom Fiscal Year Calendar Table which is Date Table. The FY starts in July and ends in June. The week starts on Saturday and ends on Frid...
  • mark_endicott's avatar
    mark_endicott
    1 year ago

    arp2 - this will work for last week:

     

    VAR LastWeekStart =
        SELECTEDVALUE ( FYCalendar[WeekStart] ) - 7
    VAR LastWeekEnd =
        SELECTEDVALUE ( FYCalendar[WeekEnding] ) - 7
    RETURN
        CALCULATE (
            DISTINCTCOUNT ( MasterProjListR02[Project Number] ),
            REMOVEFILTERS ( FYCalendar ),
            MasterProjListR02[Project Creation Date] >= LastWeekStart,
            MasterProjListR02[Project Creation Date] <= LastWeekEnd
        )

     

    and your measure for YTD will already work:

    see attached file

     

    If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!