Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Previous Week and Previous Month DAX

Hi There,   I am fairly new to power BI and trying to figure this out.. I want to create a date table that will have a series how collumns that show a "Yes" or "No" value based on specfied date ran...
  • v-yuta-msft's avatar
    7 years ago

    Hi wupdedu,

     

    To achieve your requirement, create two calculate columns using DAX formula like pattern below:

    Last Month = IF(MONTH([Date]) = MONTH(EDATE(TODAY(), -1)), "Yes", "No") 
    
    Last Week = 
    VAR Current_Week = CALCULATE(MAX([Week No]), FILTER(Table1, Table1[Date] = TODAY()))
    RETURN
    IF([Week No] = Current_Week, "Yes", "No")

     

     

    Regards,

    Jimmy Tao