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
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
v-yuezhe-msft
Employee
Employee

@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

Community Support Team _ Lydia Zhang
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

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

v-yuezhe-msft
Employee
Employee

@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

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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
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.