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

Calculating rolling 12 months risk score

I am trying to calculate a risk score using rolling 12 months.  The risk scores I want to assign out are 0, 5, 10, 15.  The calculation would assign a 0 if the date is within 12 months, 5 if it is in the previous 12 months, 10 if in the previous 12 months after that, and 15 if in the previous 12 months after that or does not have a date.  Below is the data that I have and i want the risk score to be calcualted on the reporting date. 

 

UnitLast AuditAudit Age
DogsSunday, January  1, 20173
CatsTuesday, January 1, 20191
BirdsWednesday, January 1, 20200
HorsesTuesday, January 1, 20191
BunniesFriday, January 1, 20164
MiceThursday, January 1, 20155
1 ACCEPTED SOLUTION

@Anonymous 
I guess you have create a column using the formula?

Check out the pbix attached, you should create a measure for this requirement.


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@Anonymous 

I guess this is not a rolling n months question, using Switch() is more appropriate, try this measure:

Measure = SWITCH(TRUE(),
SUM('Table'[Last Audit])>TODAY()-365, 0,
SUM('Table'[Last Audit])<TODAY()-365 && SUM('Table'[Last Audit])>TODAY()-365*2,5,
SUM('Table'[Last Audit])<TODAY()-365*2 && SUM('Table'[Last Audit])>TODAY()-365*3,10,
SUM('Table'[Last Audit])<TODAY()-365*3 && SUM('Table'[Last Audit])>TODAY()-365*4,15,15)

 

 

riskscore.JPG

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

When i did that formula i got all 0s for every line item.  Below is what i used:

 

Rolling Last Audit = SWITCH(TRUE(),
SUM('Project Status'[Report Issue Date].[Date])>TODAY()-365, 0,
SUM('Project Status'[Report Issue Date].[Date])<TODAY()-365 && SUM('Project Status'[Report Issue Date].[Date])>TODAY()-365*2,5,
SUM('Project Status'[Report Issue Date].[Date])<TODAY()-365*2 && SUM('Project Status'[Report Issue Date].[Date])>TODAY()-365*3,10,
SUM('Project Status'[Report Issue Date].[Date])<TODAY()-365*3 && SUM('Project Status'[Report Issue Date].[Date])>TODAY()-365*4,15,15)
 
and I also tried:
Rolling Last Audit = SWITCH(TRUE(),
SUM('Project Status'[Report Issue Date])>TODAY()-365, 0,
SUM('Project Status'[Report Issue Date])<TODAY()-365 && SUM('Project Status'[Report Issue Date])>TODAY()-365*2,5,
SUM('Project Status'[Report Issue Date])<TODAY()-365*2 && SUM('Project Status'[Report Issue Date])>TODAY()-365*3,10,
SUM('Project Status'[Report Issue Date])<TODAY()-365*3 && SUM('Project Status'[Report Issue Date])>TODAY()-365*4,15,15)
 
Project Status is my table name and Report Issue Date is the column (its the same formate as Last Audit column in the orginal data i supplied)

@Anonymous 
I guess you have create a column using the formula?

Check out the pbix attached, you should create a measure for this requirement.


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Not very clear.

But you can can rolling 12 month value with date table like

 

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

 

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 :radacad sqlbi My Video Series Appreciate your Kudos.

Anonymous
Not applicable

So i do not have any sales data.  I am performing a risk assessment so i have all these companies with their audit report ratings and the date the report went out.   I want to figure out how to perform a rolling 12 month calculation where it would assign a company  the following risk scores:

  • 0 if the reporting date was within 12 months
  • 5 if the reporting date was in the previous 12 months
  • 10 if the reporting date was in the previous 12 months from that
  • 15 if the reporting date was in the previous 12 months from that or does not have a reporting date at all (meaning it was never audited)

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.