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

Need help samelastperiod bug

I have a Total Sales and  Total Sales LY = CALCULATE([Total Sales]; SAMEPERIODLASTYEAR('Calendar'[Date]))

 

when I choose any date before the actual last day of my database (13/9/2018) let's say from 8/9/2018 - 12/9/2018 the system returns perfect-correct subtotals for every day and correct TOTALS.   

When I choose the last day in this context 13/9/2018 the subtotals are correct per day but not the Total and calculates hiddenly or on the background) the remaining value of the next days from 14/9/2017 to 30/9/2017 (sic)

Therefore when I do a period of September the system calculates every day correct and the total is the Total of September 2017!!

 

example from 1/9-12/9

date         total    total LY

1/9/2018 10.00       8.00

5/9/2018  20.00      2.00

12/9/2018 30.00   10.00

-------------------------

Total          60.00   20.00

 

example from 1/9-13/9

date         total    total LY

1/9/2018 10.00      8.00

5/9/2018  20.00     2.00

12/9/2018 30.00  10.00

13/9/2018 20.00    5.00

-------------------------

Total          80.00  70.00 (instead of 25.00)

 

Also when I choose whole month I receive 80.00 sales and 70.00 for LY and not 25.00 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Sample data or PBIX would help recreate. 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

 

That being said, you may just be having an issue with measure totals. This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 

Although, headaches like this with TI functions are one reason I created the Time Intelligence the Hard Way Quick Measure. https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

Sample data or PBIX would help recreate. 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

 

That being said, you may just be having an issue with measure totals. This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

 

Although, headaches like this with TI functions are one reason I created the Time Intelligence the Hard Way Quick Measure. https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.