Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Multiple month columns to align for chart

Hi All,

I have table as below and I need to have a graph for last 13 months (Ex: Oct2017 to Oct 2018), can any one help hpw to arrange data to build stacked bar or line graph.

 

ProductTotal Region=Jan 2017Actual ResultsTotal Region=Feb 2017Actual ResultsTotal Region=Mar 2017Actual ResultsTotal Region=Apr 2017Actual ResultsTotal Region=May 2017Actual ResultsTotal Region=Jun 2017Actual ResultsTotal Region=Jul 2017Actual ResultsTotal Region=Aug 2017Actual ResultsTotal Region=Sep 2017Actual ResultsTotal Region=Oct 2017Actual ResultsTotal Region=Nov 2017Actual ResultsTotal Region=Dec 2017Actual ResultsTotal Region=Jan 2018Actual ResultsTotal Region=Feb 2018Actual ResultsTotal Region=Mar 2018Actual ResultsTotal Region=Apr 2018Actual ResultsTotal Region=May 2018Actual ResultsTotal Region=Jun 2018Actual ResultsTotal Region=Jul 2018Actual ResultsTotal Region=Aug 2018Actual ResultsTotal Region=Sep 2018Actual ResultsTotal Region=Oct 2018Actual Results
A99.98%100%99.98%99.15%99.15%100%99.98%99.15%99.15%100%99.98%99.98%99.15%100%100%100%99.98%99.15%100%99.98%99.98%100%
B99.98%100%99.98%99.15%99.15%100%99.98%99.15%99.15%100%99.98%99.98%99.15%100%100%100%99.98%99.15%100%99.98%99.98%100%
C99.98%100%99.98%99.15%99.15%100%99.98%99.15%99.15%100%99.98%99.98%99.15%100%100%100%99.98%99.15%100%99.98%99.98%100%
D99.98%100%99.98%99.15%99.15%100%99.98%99.15%99.15%100%99.98%99.98%99.15%100%100%100%99.98%99.15%100%99.98%99.98%100%
E99.98%100%99.98%99.15%99.15%100%99.98%99.15%99.15%100%99.98%99.98%99.15%100%100%100%99.98%99.15%100%99.98%99.98%100%
F99.98%100%99.98%99.15%99.15%100%99.98%99.15%99.15%100%99.98%99.98%99.15%100%100%100%99.98%99.15%100%99.98%99.98%100%

Thanks in advance.

MM

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous,

Unpivot your columns, then create YearMonth, MonthName, MonthNumber column in Power BI Desktop query Editor.

After applying changes to report view, create the following columns in your table.

Date = DATE(Table1[Year],Table1[MonthNumber],1)
LAST13MONTH = DATEDIFF(Table1[Date],TODAY(),MONTH)<=12


Create a line chart, drag the LAST13MONTH collumn to visual level filter and set its value to True. For more details, please review attached PBIX file.
1.PNG

 



Regards,
Lydia

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi All,

 

I have data in Excel, but once I have get uploaded in PBI the PBI should consider only last 14 months data from the table.

Any suggestion or help will be great.

 

Thanks in advance.

Murali.

@Anonymous Please use the "Power Query" to filter the last 14 months data, use "Custom Filter" on the date field that you want to filter on.... 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Do you have any Date column in Excel Sheet? @Anonymous

Anonymous
Not applicable

@Anonymous,

Unpivot your columns, then create YearMonth, MonthName, MonthNumber column in Power BI Desktop query Editor.

After applying changes to report view, create the following columns in your table.

Date = DATE(Table1[Year],Table1[MonthNumber],1)
LAST13MONTH = DATEDIFF(Table1[Date],TODAY(),MONTH)<=12


Create a line chart, drag the LAST13MONTH collumn to visual level filter and set its value to True. For more details, please review attached PBIX file.
1.PNG

 



Regards,
Lydia

PattemManohar
Community Champion
Community Champion

@Anonymous Could you please try, unpivoting all the MonthYear Fields and then have two fields as "Month" and "Year". Now, you have data in more structured format. Then you can use Year and Month fields to create a hierarchy for each product (which you can drill-through)





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors