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
Marcin
Helper V
Helper V

12 month sum vs time filter

Hi,

 

I know that this topis was discussed many time but I am struggling with this problem.

 

I use data from ContosoRetailDW base as a demo, I would like to built measue calculatin sum of last 12 months ( currrent inculded )

 

I would also to present this data in 12 month range visuals beteween max date ( set manually ) - 12 months. 

 

I have created a measure like this, with ALL function to be able to see proper SUM while using Date filter. 

 

Last 12M sales amount = CALCULATE([Sales amount],ALL(DimDate[Datekey]),DATESINPERIOD(DimDate[Datekey].[Date],LASTDATE(DimDate[Datekey].[Date]),-1,YEAR))
 
But I have two problems:
 
First when I filter by TimeYear = 2009 I got also calculation 2010 
Second for January 2009 I would like to get SUM of 2008 too. 
 
Capture.PNG
 
Is the any possibility to publish pbx file here ? 
3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @Marcin,

 

It would be better that you can share the sample .pbix file for check. Do mask sensitive data before uploading.

 

Regards,

Yuliana Gu

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

Hi,

 

How can I publish file here  I also asked ?

 

Should I use external disk service to share file ?

 

As I mentioned I used data from ContoRetailDW ( Microsoft demo db ) so there is no need to mask any data.

 

Marcin

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.