Forum Discussion

AppGuySCS's avatar
AppGuySCS
Frequent Visitor
2 years ago

PMTD Measure Not Correct - KPIs wrong

I'm still relatively new to Power BI and the one area I'm having consistent struggle with is the MTD and PMTD measures. 

The measures are built using these variations (I've tested them all and can't seem to get the same number as when I drop the column into the Card and then add the Relative Date n filter of "In the Last 1 Calendar Month"). I don't need prior MTD/YTD, I need actual calendar month total. 

Test #1 - 

CALCULATE(COUNT('01 - Open Data'[File #]), DATESMTD(ENDOFMONTH(dateadd('02 - Date Table'[Date],-1,MONTH))))
Returns YTD/MTD Total (not correct for Jan 2024)

Test #2 -
PMTD Opens = CALCULATE(
    COUNT('01 - Open Data'[File #]),
    FILTER(
        '01 - Open Data',
        '01 - Open Data'[Open Date].[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()) - 1, 1) &&
        '01 - Open Data'[Open Date].[Date] <= DATE(YEAR(TODAY()), MONTH(TODAY()) - 1, DAY(TODAY()))
    )
)
Returns a value of 621 that is approximately 1/5th of the prior month actual total of 3,586. 

The correct total for the month of January 2024 should be 3,586. 

What's even more odd, is this measure only fails to pull the correct number on Open File Counts. My closed measures are all spot-on. 

I'm using the auto date/time intelligence and I have built a custom date table (marked as a date table) but isn't related to the core data because it goes a little crazy. 

A copy of my PBI file cannot be uploaded due to the amount of data and the time required to sanitize it. 

Any help would be much appreciated. I've combed the forums and read a hundred articles on time intelligence, but this answer elludes me. 

//** UPDATED INFO **//

 



2 Replies