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

Column Chart - Past 6 Months

How would you show the last 6 months on a column chart (on the X axis).

So if I want to show the previous 6 months of April I want it to appear as the following

Nov > Dic > Jan > Feb > Mar> April

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @austinsonger 

Show last 6 months data, you could create measures

last month = EDATE(TODAY(),-1)

Measure 2 = CALCULATE(SUM('Table'[value]),FILTER('date',DATEDIFF([Date],[last month],MONTH) in {0,1,2,3,4,5}))

To sort the month name as expected, you could refer to the following:

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

If it doesn't solve your problem, you could use format "2019-02" instead of "Feb" which can order the axis as expected.

Use FORMAT([date],"yyyy-mm") can get this format.

 

 

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

It's not working for me... I must be doing something wrong.

 

Screen Shot 2020-05-06 at 10.37.36 AM.png

 

Anonymous
Not applicable

Just create a measure that will return 1 for the months you want to display and BLANK for others and then filter the visual by this measure.

More specifically, the measure should sense the last month in the current context and make sure that for the 6 last months it returns 1 and for all others 0 (or BLANK). Then filter the visual by setting the measure's value to 1.

Best
D

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.