San Antonio Power BI User Group

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
Expand all | Collapse all

Trying to Generate Fiscal Month to Date

  • 1.  Trying to Generate Fiscal Month to Date

    Posted Jun 17, 2019 11:15 AM
    My calendar has date, and first day of fiscal month in it.  I am trying to make a flag if the day is in current fiscal month but it isn't working.  Can someone help me out?

    Is Fiscal MTD =
    var firstdayofmonth = CALCULATE(DISTINCT('Calendar'[FirstDayOfFiscalMonth]),'Calendar'[Is Yesterday] = 1)
    return
    if('Calendar'[USADay]>= firstdayofmonth && 'Calendar'[USADay]< TODAY(),1,0)


    ------------------------------
    Ryan Beckham
    Manager, Data Science
    2542283307
    ------------------------------


  • 2.  RE: Trying to Generate Fiscal Month to Date

    Posted Jun 19, 2019 09:51 AM
    Ryan,
    Would the function Date.IsInCurrentMonth work for you?

    ------------------------------
    Benjamin Weis
    Adv Internal Controls Auditor
    San Antonio TX
    2106267565
    ------------------------------



  • 3.  RE: Trying to Generate Fiscal Month to Date

    Posted Jun 19, 2019 01:36 PM
    It doesn't because Fiscal Calendar Month is different than the Calendar Month :(

    I get the same issue when I try to run code like this.
    When I drop the column into the workspace, it shows current pay week.  But I when I use it as a filter on a calendar, it gives me 1 day and not 14.

    _Current Pay Week =
    var currentpayweek = CALCULATE(distinct('Calendar'[Pay Period]),'Calendar'[USADay] = TODAY()))
    RETURN
    if('Calendar'[Pay Period] = 13, 1, 0)

    ------------------------------
    Ryan Beckham
    Manager, Data Science
    2542283307
    ------------------------------