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
Anonymous
Not applicable

Sameperiodlastyear filter

Hi experts 

 

How would you integrate the same period last year function into the following DAX..

CALCULATE( [Net Sales BM PY] , FILTER( ALL(Profitability[DIM_POSTING_DATE_SK]), CONTAINS( VALUES('DateFilter'[DIM_DATE_SK]),'DateFilter'[DIM_DATE_SK], Profitability[DIM_POSTING_DATE_SK] ) ) ))
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi,@Route11 

    You can use SAMEPERIODLASTYEAR Function to add a calculate measure like this:

Measure 2 = CALCULATE([Measure],SAMEPERIODLASTYEAR(Table2[Date]))

Result:

7.PNG

Best Regards,

Lin

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

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi,@Route11 

    You can use SAMEPERIODLASTYEAR Function to add a calculate measure like this:

Measure 2 = CALCULATE([Measure],SAMEPERIODLASTYEAR(Table2[Date]))

Result:

7.PNG

Best Regards,

Lin

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

Hi @Anonymous,

 

This information is very limited to give you an answer please see this post regarding How to Get Your Question Answered Quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 (courtesy of @Greg_Deckler).

 

Can you provide addtional information on what is the expected result and calculations your need to make.

 

Regards.

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

MFliex - thi si what i came up with

CALCULATE(
        CALCULATE(
        [Net Sales BM]
        ,
        FILTER( ALL(Profitability[DIM_POSTING_DATE_SK]),
            CONTAINS( VALUES('DateFilter'[DIM_DATE_SK]),'DateFilter'[DIM_DATE_SK], Profitability[DIM_POSTING_DATE_SK] ) )
         )
        ,
       SAMEPERIODLASTYEAR(DateFilter[Full Date])

 )

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.