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
Philjon
Regular Visitor

"Current Month" as column header (and previous months). Need to auto correct to actual month

I'm trying to transform data so that it is more friendly to the end user. The data below is an example of what I have. I would like to convert the column headers to read current month plus prior months. It needs to be rolling 12 in the report because stocking decisions on items are base on historical data in the past 12 months.

 

part numberCurrent monthCurrent month  less 1Current Month less 2Current month less 3Current month less 4Current month less 5
1a1020131
1a2442305
1a3000001
1b1200000
1b2111302
1b3012543

 

Would like the headers to read - 

Part number19-Apr19-Mar19-Feb19-Jan18-Dec17-Dec

 

I can change the headers manually, but I need the report to show rolling 12 info and update automatically. 

 

Thanks for the help!

 

1 REPLY 1
Anonymous
Not applicable

@Philjon 

 

Not sure if this is what you want, but I have a bar graph with a month year axis. I need this axis to show only as a rolling 12 month period (So as of now I have data till March 2019 and my axis shows only from March 2018-March 2019)

 

what I do is I have a rolling 12 column that looks as follows:

 

Last 12 Months = VAR MaxDateV = CALCULATE(MAX('Date'[Date]), FILTER(ALL('Date'), 'Date'[Date]=MAX('Date'[Date]))) VAR CalDateMaxDateDiff = DATEDIFF(MaxDateV, 'Date'[Date], MONTH) RETURN SWITCH(TRUE(), CalDateMaxDateDiff>=-12 && CalDateMaxDateDiff<=0, "Yes","No" )
 
Then for my bar graph, I choose visual level filter of this measure to be "Yes". So each time it would only show me the last 12 months. (Also, for me the part MAX('Date'[Date]) is a reference to the end date of the previous month which is 3/31/2019) - So my graph shows from March 2018 - March 2019.

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.