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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Kaikin
Regular Visitor

Calculate 12 month rolling and standard deviation population

Hi expert,

i am newbie in Power Bi.

I had been ask to calculate the Sales Volatility, which formula  (standard deviation of the entire population) / (Average past 12 months amount)

Please advise. thanks

Kaikin_0-1714982515882.png

 

 

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @Kaikin ,

 

I would like to confirm the valuable input provided by the @Sergii24 .  However, I noticed that more details are needed to fully understand this.

 

1. create MEASURE and calculate the standard deviation for the current year.

PopulationStandardDeviation =
CALCULATE(STDEV.P('Table'[Total]),FILTER(ALL('Table'),'Table'[Product] = MAX('Table'[Product]) && YEAR('Table'[date]) = YEAR(MAX('Table' [date]) )))

 

2. Create MEASURE to calculate the average of the last 12 months.

AveragePast12Months =
CALCULATE(
AVERAGE('Table' [TOTAL]),
FILTER(ALL('Table'), 'Table'[date] >= EOMONTH('Table'[date],-13) + 1 && 'Table'[date] <= MAX('Table'[date]))
)

 

3. Get their quotient.

SalesVolatility =
DIVIDE(
[PopulationStandardDeviation],
[AveragePast12Months]
)

 

vkaiyuemsft_0-1715050352660.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

2 REPLIES 2
v-kaiyue-msft
Community Support
Community Support

Hi @Kaikin ,

 

I would like to confirm the valuable input provided by the @Sergii24 .  However, I noticed that more details are needed to fully understand this.

 

1. create MEASURE and calculate the standard deviation for the current year.

PopulationStandardDeviation =
CALCULATE(STDEV.P('Table'[Total]),FILTER(ALL('Table'),'Table'[Product] = MAX('Table'[Product]) && YEAR('Table'[date]) = YEAR(MAX('Table' [date]) )))

 

2. Create MEASURE to calculate the average of the last 12 months.

AveragePast12Months =
CALCULATE(
AVERAGE('Table' [TOTAL]),
FILTER(ALL('Table'), 'Table'[date] >= EOMONTH('Table'[date],-13) + 1 && 'Table'[date] <= MAX('Table'[date]))
)

 

3. Get their quotient.

SalesVolatility =
DIVIDE(
[PopulationStandardDeviation],
[AveragePast12Months]
)

 

vkaiyuemsft_0-1715050352660.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sergii24
Super User
Super User

Hi @Kaikin, and welcome to PowerBI world! 🙂
Take a look at this article - Cumulative total – DAX Patterns

If you just starting working with PowerBI I strongly suggest you to watch DAX 101 video series from SQLBI it will help you a lot to understand how calcualtions in PowerBI are made.

Good luck!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.