Forum Discussion
Syndicate_Admin
Administrator
2 years agoCalculated Column Subject to Context (Z-Score Calculation)
Hello I've been trying to create a calculated column to get the Z-Score of a piece of data segmented by a variable. I have managed to arrive at this formula (which I leave at the end), which ...
- Anonymous2 years ago
"ALL" does not apply the slicer, you can try changing it to "ALLSELECTED". "ALLSELECTED" will retain the slicer filter and remove other filters.
Please try the following:
Create a measure.
Measure = var _Average = CALCULATE( AVERAGE('Table'[Population]), FILTER( ALLSELECTED('Table'), 'Table'[Language spoken] in {[Language spoken]} ) ) var _DesvT = CALCULATE( STDEV.S('Table'[Population]), FILTER( ALLSELECTED('Table'), 'Table'[Language spoken] in {[Language spoken]} ) ) RETURN DIVIDE(SELECTEDVALUE('Table'[Population]) - _Average, _DesvT)Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ritaf1983
Super User
2 years agoPlease provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523