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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
cneumann
Frequent Visitor

Show last 13 months based on user single slicer selection

Hi all,

 

I am building a rolling 13 month net revenue chart and I've came across a requirement to show the last 13 month in x axis based in what month (YYYYMM) the user selected in a YYYYMM slicer.

 

The chart below is the one I want:
rolling 13 chart.png


In order to get the intended behaviour, currently I need to select each one of the 13 month in YYYYMM slicer:

rolling 13 slicer.png

 

Any ideas on how I can get this to work in Power BI so that the user just have to select the base month?

Thanks in advance,
Cristhian.

1 ACCEPTED SOLUTION

Hi again 🙂

 

I understand now, and I tried second approach. I created two tables, which are not related to any of tables. One is Year, with one column (values: 2010, 2011, 2012... 2016). Another is Month, with one column (values: 1,2,3...12).  

 

Then I created this measure:

Sum of profit = 
var Ldate = date(max('Year'[Year]);max('Month'[Month]);1) //Last date

var Fdate = EDATE(Ldate;-13) //First date

var SumProfit = sum('traffic'[profit]) //Calculation

return

 if(min('Date table'[Date])<fdate;
         blank();
         if(min('Date table'[Date])>Ldate;
                   blank();
                   SumProfit))

On x axis I added all months and years (2010-1, 2010-2 .... 2016-12) and in value I added measure.

Show items with no data must be unchecked.

data.pngreport.png

View solution in original post

22 REPLIES 22

Hi Michael,

 

Thanks for your reply.

 

Let's wait for the better time range filters arrive. For now, our client will use the YYYYMM slicer and the timeline slicer.

 

-Cristhian.

Hi Cristian,

 

Can we leverage the power of DAX to deploy your specific requirement.

DAX can polish your measure in a way that whenever end user selects the specific month, it will show last 13 months of rolling revenue.

 

Let me know if I can help you further.

 

 

Thanks & Regards,

Bhavesh

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.