Forum Discussion

mclawler's avatar
mclawler
Helper III
3 years ago
Solved

Add Column Last Completed Month YTD

Hi everybody, looking to add a column which either gives me a 1,0 whether the statement is true or not.  Below is a very rough draft of the requested DAX, but I think it'll relay what I'm trying to a...
  • VahidDM's avatar
    3 years ago

    Hi mclawler 

     

    What is the issue with your fornula? Try this

    Column = 
    Var _M = month(today())
    Var _Y = year(today())

    Return
    IF(month([Date])<_M&&year([Date])=_Y,1,0)

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

    Appreciate your Kudos!! 

    LinkedIn | Twitter | Blog | YouTube 




  • Manoj_Nair's avatar
    3 years ago

    mclawler- Check this out.

    LastCompletedMonthYTD = 
    IF (
        YEAR ( YourTable[Date] ) = YEAR ( TODAY () )
            && MONTH ( YourTable[Date] ) = MONTH ( EOMONTH ( TODAY (), -1 ) ),
        1,
        0
    )

    If this post helps to find solution would be happy if you could mark my post as a solution and give it a thumbs up

    Best regards

    Manoj Nair
    Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/