Forum Discussion

IAmCare's avatar
IAmCare
Frequent Visitor
8 years ago

Year To Fiscal Month Start Date

Why does this not worK? I am trying to get Year to Fiscal Month Start date -1

 

UnitCountYTFMSD = CALCULATE(COUNTROWS(FactWholesale),                                                                                                       DATESBETWEEN(FactWholesale[INV DATE (I10)],MIN(DimDate[FiscalYearStartDate]),min(DimDate[FMSD])),filter(DimDate,DimDate[IsCurrentFiscalYear]=1))

 

FMSD  =  DATEADD(DimDate[FiscalMonthStartDate].[Date],-1,DAY) which appears to be working fine.

 

Maybe there is a better way to get YTFMSD, if there is please let me know.

5 Replies

  • What I understand is that you are trying to get for example if your fiscal year starts in July that the calculation takes you June or want it to be 07/01/2017 -1?
    • IAmCare's avatar
      IAmCare
      Frequent Visitor

      Our fiscal year started 8/27/2017 and the current fiscal month started 7/1/2018.  I need to get a count from 8/27/2017 thru 6/30/2018.

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi IAmCare,

     

    Would you please provide some dummy data to make the formula more readable? Also, please illustrate the desired result with examples, show us how to calculate it correctly.

     

    Regards,

    Yuliana Gu

    • IAmCare's avatar
      IAmCare
      Frequent Visitor

      Yes thank You

      INV DATE (I10)UNIT KEY
      8/28/201710X51292
      8/29/201770X44644
      8/31/201770X44705
      9/1/201710W96236
      12/19/201770X44815
      12/19/201770X44877
      2/6/201810X53799
      2/6/201810X54154
      4/12/201810Y57102
      6/14/201815Y16499
      6/29/201810W50613
      7/2/201810Y54869
      7/23/201870Y45809

      I am also using a DimDate dimension.  For my YearToFiscalMonthStartDate I should get a count of 11 because the last 2 are in July which is the current fiscal month

      • IAmCare's avatar
        IAmCare
        Frequent Visitor

        Actually what I would like to see is Accumulating

        4 for september

        6 for sept thru dec

        8 thru Feb

        9 Thru April

        11 Thru June