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
rwong1
Helper III
Helper III

Display in bar chart

Hi,

 

I like to know if there is a way to show all 12 months of data in a bar chart but for current year only show a certain number of months based on month end completed.  For example, I completed 10 months of month end work and those months are final in 2021.  I don't want the bar chart for 2021 to show data up to 12/31 as that has not arrived yet.  I only want 2021 to show 10 months of activity.  I tried the filters on the visuals but they only allow you to select the number of months which will affect previous years as well.  I checked off January through October but that was affecting previous years and I don't want that as previous years are final and should show all 12 months.  Please let me know if someone can help.  

Thanks.

1 ACCEPTED SOLUTION

The quickest solution would be to add a relative date filter to get Date is in the last N calendar months. Since today is December 1, this would go through November 30.

AlexisOlson_0-1638393239338.png

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@rwong1 , Based on what I got, Assume you have measures

 

Sales =SUM(Sales[Sales Amount])

Last Year Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

 

Modified sales Last year = if(isblank([Sales]), blank(), [Last Year Sales ])

 

last year sales only for months, you have this year

Hi,

 

Thanks for that.  But I have slicers that control the years so I don't need a formula.  I just want to show for current year 2021 10 months of data (be it sales, financial ratios, etc).  How do I do that?  All the other years have all 12 months as those are legacy data.  But 2021 is showing YTD revenue (includes November which is not finished), not what I selected in the slicer which is just Jan-October.  Please see below:

rwong1_0-1638384509928.png

rwong1_1-1638384569975.png

 

 

The quickest solution would be to add a relative date filter to get Date is in the last N calendar months. Since today is December 1, this would go through November 30.

AlexisOlson_0-1638393239338.png

I tried the basic filtering and that was the one that worked.  From the list of dates, I checked off everything I needed.  Thank you.

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.

Top Solution Authors