Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
spencer_g
Helper I
Helper I

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 1
v-yuezhe-msft
Employee
Employee

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.
1.png

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


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.