Forum Discussion
Anonymous
5 years agoNot applicable
Min-max normalization with averages values
Hello to the team, I have been trying to do some min max normalization on average value, I am sorry because I have found some resources here but I can't seem to make it work. It's my first time u...
- 5 years ago
Hi Anonymous ,
Use the following measures:
averagE1 = VAR averagE1 = CALCULATE ( ROUND ( AVERAGE ( Table1[Value] ), 1 ), FILTER ( ALLSELECTED ( Table1 ), Table1[Attribute] = MAX ( 'Table1'[Attribute] ) && Table1[Name] = MAX ( Table1[Name] ) && Table1[vlauetype] = MAX ( Table1[vlauetype] ) ) ) RETURN averagE1maxvalue2 = CALCULATE ( MAXX ( Table1, [averagE1] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Attribute] = MAX ( 'Table1'[Attribute] ) && Table1[vlauetype] = MAX ( Table1[vlauetype] ) ) )minvalue2 = CALCULATE ( MINX ( Table1, [averagE1] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Attribute] = MAX ( 'Table1'[Attribute] ) && Table1[vlauetype] = MAX ( Table1[vlauetype] ) ) )Out2 = ROUND ( ( [averagE1] - [minvalue2] ) / ( [maxvalue2] - [minvalue2] ), 2 )Final you will get what you want!
Wish it could help you!
Best Regards
Lucien
v-luwang-msft
Community Support
5 years agoHi Anonymous ,
Use the following measures:
averagE1 =
VAR averagE1 =
CALCULATE (
ROUND ( AVERAGE ( Table1[Value] ), 1 ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[Attribute] = MAX ( 'Table1'[Attribute] )
&& Table1[Name] = MAX ( Table1[Name] )
&& Table1[vlauetype] = MAX ( Table1[vlauetype] )
)
)
RETURN
averagE1maxvalue2 =
CALCULATE (
MAXX ( Table1, [averagE1] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[Attribute] = MAX ( 'Table1'[Attribute] )
&& Table1[vlauetype] = MAX ( Table1[vlauetype] )
)
)
minvalue2 =
CALCULATE (
MINX ( Table1, [averagE1] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[Attribute] = MAX ( 'Table1'[Attribute] )
&& Table1[vlauetype] = MAX ( Table1[vlauetype] )
)
)Out2 =
ROUND ( ( [averagE1] - [minvalue2] ) / ( [maxvalue2] - [minvalue2] ), 2 )
Final you will get what you want!
Wish it could help you!
Best Regards
Lucien
- Anonymous5 years agoNot applicable
Thank you very much that's perfect it works, and I learnt a lot on how PowerBI handles variables.
It's very slow so I might need to look into that later, but this is an another story. Thank you !