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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MungoSerge
New Member

Calculate Standardize to remove data points - power pivot Z-Score

Hi all,
I'm trying to build a model using Power Pivot (data is already loaded into power query). I'm having a difficult time trying to create a power pivot measure that would return what I believe is called the Z-Score.
Over each set of data I need to calculate the average and the standard deviation, to then determine the Z-Score; which will then highlight any data points that are outside the 'normal' range within the data. I have done this previously in Excel with formula on a worksheet using AVERAGE, STDEV.P, and STANDARDIZE, but struggling to replicate in power pivot.

The image below is just a small illustration of my data from an existing query. There are several teams, dates (with associated workdays), and then the numbered columns reflect the hour and the score achieved in each hour on that date for that team. What I would like to do is select in a pivot table a date range, and then return what the z-score would be – for example based on that table it would be the z-score for each date and time, so 20 results in total – but the averages, standard deviation etc should only be calculated against that team name on that weekday and for that hour.
I’m basically trying to highlight anomalies over say a 10 week period for that day of the week at that time, and then calculate an average once I’ve removed the anomalies from the data (for that day of the week at that hour interval).
I have tried a few different approaches with measures, but nothing seems to be quite right, and I’m unsure if it isn’t the measures that are the problem, but rather how my data is organised in the query.

 

MungoSerge_0-1732801715956.png

3 REPLIES 3
Anonymous
Not applicable

Hi @MungoSerge ,

 

The DAX language also includes functions such as AVERAGE and STDEV.P. Please refer to these links for more information.

https://learn.microsoft.com/en-us/dax/average-function-dax

https://learn.microsoft.com/en-us/dax/stdev-s-function-dax

 

If you need more specific assistance with the formula, as suggested by @lbendlin , it would be helpful to provide some sample data.

 

Best Regards,

Bof

 

 

Omid_Motamedise
Super User
Super User

AS you whant to calculate (x-AVG)/sd you can use the below function in Dax, if your table name is X and your data in one column namely data (it would be better to unpivot your data and show them into one column, as it is harder to operate over the columns)

 

Z = 

var AVG = calculate(average(X[data]),all(X)),

return (X[data] - AVG) / X[SD]

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors