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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Siops
Regular Visitor

Previous Month and Current Month same period --- with filter

Hello! I tried several calculations from this forum and also watched some videos regarding the current and previous month measurement but I am getting a different result when I tried those formula on my end.

 

These are my measurements -

 

MTD =
CALCULATE(
    SUM(Sample[Case])
    , DATESMTD(Sample[Date])
)
 
Last MTD =
CALCULATE(
    'Sample'[MTD]
    , DATEADD('Sample'[Date], -1, MONTH)
)
 
Siops_0-1725041204227.png

 

Siops_1-1725041216964.png

 

 I got a different results based on one of the answer here and also from one of the video.
 
1. MTD field should be cumulative. I am getting the same value of my 'Case' field
2. Last MTD field should show the previous value. For example, under January 2, it should show 56 cases. But my whole Last MTD field is showing blank except that it is showing a value under Total. It is a SUM of all months minus the latest month.
3. Once I click a Month Filter/Slicer, the Last MTD will show as "(Blank)" 
1 ACCEPTED SOLUTION

You need to use a Dates table for time intelligence functions.

 

lbendlin_0-1725125063608.png

 

 

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi, this is my sample data 

https://drive.google.com/file/d/13OQVLW4fRwaSJ2d_FFLMj-g_wV98BgXb/view?usp=drive_link

 

This is the output that i want to achieve 

https://youtu.be/Gw0t4TKkzE4?si=2Bd4BdI9_Ir-y7QL

 

 

  • based on the video, the MTD will show cumulative numbers but I am getting the same value of total cases.

    the PREV Month on the video will show numbers per day based on the previous month's data, but it is showing blank on my end, but it has a value under Total which is the sum of all months minus the latest month
  •  
  • also, when i click a slicer filter for months, the PREV will become blank

You need to use a Dates table for time intelligence functions.

 

lbendlin_0-1725125063608.png

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.