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

Last N Months Measures

Hello!

 

I have a Measure called NPS Score. This score is calculate liked this:

NPS Score =
var PromoterDetractor =
CALCULATE(Detail[Total Surveys],FILTER(Detail,Detail[Recommend Rating] = "Promoter")) - CALCULATE(Detail[Total Surveys],FILTER(Detail,Detail[Recommend Rating] = "Detractor"))

var Percentage =
divide(100,Detail[Total Surveys])

RETURN
PromoterDetractor * Percentage

 

I would like to have a table chart that looks like this:

mkopp12990_0-1654281926805.png

 

I am struggling figuring out how to do this. I would like the NPS score as of what whatever the N filter would indicate. How do you create a Measure for that? Thank you!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can use a what if parameter

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

 

you will get what measure

What if meausre  = selectedvalue(param[param])

 

example , the new measure

Rolling N = CALCULATE([NPS Score],DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-1 * [What if meausre],MONTH))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , You can use a what if parameter

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

 

you will get what measure

What if meausre  = selectedvalue(param[param])

 

example , the new measure

Rolling N = CALCULATE([NPS Score],DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-1 * [What if meausre],MONTH))

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.