Forum Discussion

ThuJa23's avatar
ThuJa23
Icon for Advocate II rankAdvocate II
4 years ago
Solved

Working days and Days gone

Hi everyone,  I have a table as below, which: - DATE DE is from individual Calendar table - ATMONTH_ and ATLDF_ are from another table (which date in this table has already relationship with calen...
  • v-jingzhang's avatar
    4 years ago

    Hi ThuJa23 

     

    You could simplify your calculation by using Today_ = FORMAT(TODAY(),"dd.mm.yyyy") to get today's date in format "dd.mm.yyyy".

     

    For daygones calculation, you could try below code. You will get yesterday's date by using today()-1.  

    daygones =
    VAR Yesterday_ = FORMAT ( TODAY () - 1, "dd.mm.yyyy" )
    RETURN
        CALCULATE ( MAX ( FAC_Workdays[ATLDF_] ), 'Date'[DATE DE] = Yesterday_ )
    

     

    Hope this helps.

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.