cancel
Showing results for
Did you mean:
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

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

3 REPLIES 3
Highlighted
Super User IV

@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://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...

Proud to be a Super User!

Highlighted
Frequent Visitor

@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

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

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Microsoft Power Platform Communities

Check out the Winners!

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors