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.
Syndicate_Admin
Administrator
2 years agoHello
Here is an example of how the data would be distributed.
| Region | Country | Language spoken | Population |
| Europa | Spain | Spanish | xxxx |
| Europa | Spain | Catalan | xxxx |
| Europa | Spain | Basque | xxxx |
| Europa | Spain | Catalan | xxxx |
| America | Argentina | Spanish | xxxx |
| America | Chile | Spanish | xxxx |
| America | Brazil | Portuguese | xxxx |
| America | Dominican Republic | Spanish | xxxx |
| America | Dominican Republic | French | xxxx |