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
mboucher_rcr
Frequent Visitor

Last 3 months from 3 years ago

Hi,

 

I have the below formula to give me total qty sold over the last 3 months.

 

Qty L3 = CALCULATE (
[TotalSalesQty],
DATESINPERIOD (
'Date'[Date],
EOMONTH(TODAY(),-1),
-3,
MONTH
))
 
What I need now is to get the total quantity sold for that same 3 month period, from 3 years ago. I've tried a range of things using parallelperiod, datesinperiod and datesbetween but just can't seem to get the results.
 
One I have tried is the below but it returns no data:
Qty L3 -3Yrs = CALCULATE (
[TotalSalesQty],
DATESINPERIOD (
'Date'[Date]
EOMONTH(TODAY(),-36), 
-3
MONTH
))
 
Thanks,
Michael
4 REPLIES 4
amitchandak
Super User
Super User

@mboucher_rcr , You have all the required dates in the date table. measn dat table should have date for at least last 39 month 

date table is marked as date table.

 

The date in fact do not have timestamp

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

I do seem to have a date table problem.

 

When I select the date table "Date" field to show on the report by itself, I see all dates from 1/1/2000 onwards.

 

If I select to show the date field from my sales data table by itself, I see all dates from when data began on 1/7/2007.

 

But when I select both date fields, the results are suddenly limited to starting at 1/7/2019.

 

What could be causing this limitation?

Never mind I have found the issue, it was the joins with some other tables that had data starting on 1/7/2019. Thanks!

@mboucher_rcr , Thanks for the update. Good, that issue is resolved.

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.