cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Rolling 12 Month Measure

I am trying to make a report to calculate net promoter score based off of a survey sent to customers.

My data has:

  • a unique number for each response
  • details about the person who responded
  • the date the response was given
  • the score the person gave out of 10.

The responses are categorized into promoters (score >= 9) and detractors (score <= 6) and then the net promoter score is calculated as (# of promomoters) - (# of detractors) / (# of responses)

The end result is that I want to have a bar graph for each month which displays a rolling calculation of the net promoter score based on the responses from the last 12 months. So the bar for June 2020 would calculate the score based on responses from June 2019 through June 2020, etc. I tried doing this with calculated columns, but the problem is that I need to then be able to filter and slice this graph based on different values both in the table of raw data and in related tables. For reference I had tried this solution but it wasn't able to be sliced: https://community.powerbi.com/t5/Desktop/Trailing-12-or-Rolling-12-month-sum/m-p/164419#M71715

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Rolling 12 Month Measure

Solved my problem using unpivoting. Made columns for each of the 12 months following the submission date and unpivoted it, then used the date as my x axis and measures as the y axis

View solution in original post

3 REPLIES 3
Highlighted
Super User IX
Super User IX

Re: Rolling 12 Month Measure

@Sharpworks , You can get rolling like

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-12,MONTH))

 

with date table.

 

If you want display for 12 months -https://www.youtube.com/watch?v=duMSovyosXE

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Frequent Visitor

Re: Rolling 12 Month Measure

@amitchandak I have tried those formulas and while they did work, the problem was that when I would slice the data, those values would not change because they were in a calculated column. I tried using a measure but I could only get the measure to calculate for the current month, not the past 12

Highlighted
Frequent Visitor

Re: Rolling 12 Month Measure

Solved my problem using unpivoting. Made columns for each of the 12 months following the submission date and unpivoted it, then used the date as my x axis and measures as the y axis

View solution in original post

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors