Forum Discussion

spencer_g's avatar
spencer_g
Helper I
9 years ago

PREVIOUSMONTH time intelligence

Hello Everyone, 

 

I am working with data that shows the number of visitors to a website, and I would like to show the previous month's total visitors and then ultimately the same month last year. Currently the formula I am using returns (BLANK) but I know that is defintiely not that correct answer. Here is the forumla I am using:

 

Visitors PMNTH = CALCULATE(SUM('A General Usage'[Visitors]), PREVIOUSMONTH('A General Usage'[Date]))

 

Can anyone shine some light on what I might be doing wrong, or what might not be setup correctly?


Thanks in advance!

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi spencer_g,

    In your scenario, you need to have a calendar table, then create relationship using date columns between your current table and the calendar table, which is shown in the following similar screenshot.


    This way, your measure should return right values. For more details, please review the example in the attached PBIX file.


    Thanks,
    Lydia Zhang