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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
spartan27244
Helper II
Helper II

Can't seem to apply SAMEPERIODLASTYEAR correctly

The following calculation gives me a value called PMPM on my report correctly, and displays the correct amounts.

PMPM = Sum(Paid) / Sum(MM)

 

to get the previous years I was attempting

PMPM-PY = Calculate(Sum(Paid) / Sum(MM), SAMEPPERIODLASTYEAR(Dates[Date]))

Where Dates is my Marked Date table, however this does not yield any results. The PMPM calculation is cleary confined to the time period on the report, currently (10/1/2019 - 9/20/2020) so I am uncertain of why the previous year would not be able to infer this.

 

2 REPLIES 2
Fowmy
Super User
Super User

@spartan27244 

Did not quite got it, anyhow , can you try this modified version:

PMPM-PY = 
DIVIDE(
    Sum(Table[Paid]),
    Calculate(
        Sum(Table[Paid]),SAMEPERIODLASTYEAR(Dates[Date])
    )
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

To try and break this down a bit to a more simpler calculation to get the flow...

A simple sum of a Base Table Amount "MedPlanPaid" is shown on the left of the grid, next to it is a measure that calculates the exact same value as Sum(MedPlanPaid), The problem in this context is how to reference  the previous year. So in the grid the PY calculation (far right) should show the same value as the previous row (i.e. previous year). If I can do that, then I can expound on the calculation to get where I want to go. Here is a snapshot of the visual 

 

spartan27244_1-1621631823100.png

 

And a snippet of the model showing the replation show between report periods, the date table and the claims data

 

spartan27244_2-1621631917122.png

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.