dax measure sameperiodlastyear

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Power BI training and help » DAX Measure SAMEPERIODLASTYEAR

DAX Measure SAMEPERIODLASTYEAR

· Medium Priority · Version 365

Adam has attended:
Power BI DAX course

DAX Measure SAMEPERIODLASTYEAR

Hi,

I've got a simple dataset that has a main data table (composite) and a dynamic dates table, which has a many to one relationship.

I'm trying to build two measures for the same KPI, one for current and year and other for last year.

My two measures are returning the same result though and I cannot see why :( what am I missing?

Absorption CY:
Aftersales Absorption CY =
var CurrentYear = YEAR(TODAY())
var Absorption =
DIVIDE(
SUM(Composite[Service Direct Profit]) + SUM(Composite[Parts Direct Profit]),
SUM(Composite[Total Overheads]))
var AbsorptionCY = CALCULATE(Absorption, Dates[Year] = CurrentYear)
return
AbsorptionCY

Absorption PY:
Aftersales Absorption PY =
VAR Absorption =
DIVIDE (
SUM(Composite[Service Direct Profit]) + SUM(Composite[Parts Direct Profit]),
SUM(Composite[Total Overheads])
)
VAR AbsorptionPY =
CALCULATE (Absorption, SAMEPERIODLASTYEAR(Dates[Date]))
RETURN
AbsorptionPY

Also, I'll use SUMX once I've worked out whats going wrong here.

 

Training courses

 

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Power BI tip:

Explore Power BI Templates

Take advantage of Power BI templates to streamline report creation. Templates allow you to reuse custom layouts, themes, and configurations across multiple reports. Create templates for consistent branding or industry-specific reporting standards, saving time and maintaining a cohesive look across your organization's reports.

View all Power BI hints and tips


Server loaded in 0.08 secs.