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
israabuhasna
Helper I
Helper I

Trailing 12 Months of Sum Per Month

Hi,

 

I know there are many threads ont his topic however I hit a bump when I apply it to my data. My goal is to create a visual in which 12 months prior to todays month is the axis to the visual and the SUM of my sales is the column. Like any normal visual. However, when I apply this measure, the axis shows every day of every month of the past 12 months. When I drill to have the axis show only 'Months' and not 'Days' it shows only from January to December. Not from Sept 2018 to Sept 2019 which is my goal. 

Measure:

 
TTM_AwardedOpps = 
Var CurrentDate = TODAY()
Var PreviousDate = DATE(YEAR(CurrentDate),MONTH(CurrentDate)-12,DAY(CurrentDate))
Var RESULT = CALCULATE(SUM(Table[Sales]),FILTER('Table','Table'[DateAwardedLost]>=PreviousDate && 'vw_Awarded _Term_Opportunity'[DateAwardedLost]<=(CurrentDate)))
Return RESULT
My Goal visual:
Capture.PNG
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @israabuhasna ,

 

You may put date field into chart visual, remain the hierarchy Year and Month, then click button “Expand all down one level in the hierarchy” in the upper right of visualization.

 

63.png

After expanding the hierarchy:

 

64.png

 

Best Regards,

Amy

 

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

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @israabuhasna  ,

 

Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @israabuhasna ,

 

You may put date field into chart visual, remain the hierarchy Year and Month, then click button “Expand all down one level in the hierarchy” in the upper right of visualization.

 

63.png

After expanding the hierarchy:

 

64.png

 

Best Regards,

Amy

 

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

 

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.