Forum Discussion
Anonymous
7 years agoNot applicable
Maximum Value with IF Condition
I'm trying to calculate the maximum value with multiple conditions in Power BI. The dataframe is: Year Company Bond Branch Group Type Value
2016 BANCO DO BRA...
- 7 years agoHi,Your ALLEXCEPT is removing all context except for Company, which is the opposite of what you want. Put what you want to keep inside ALLEXCEPT.
CALCULATE ( MAX ( data[Value] ); ALLEXCEPT ( data; data[year]; data[Branch]; data_segmento_anual[Bond]; data_segmento_anual[Group]; data_segmento_anual[Type] ) )The other way to do it is to use ALL to specify the column that you want to be ignored.CALCULATE ( MAX ( data[Value] ); ALL ( data[Company] ) )
Kalpavruksh Technologies | Microsoft Gold Partner
Denmark | USA | India | Germany
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kalpavruksh
Resolver I
7 years agoHi,
Your ALLEXCEPT is removing all context except for Company, which is the opposite of what you want. Put what you want to keep inside ALLEXCEPT.
CALCULATE (
MAX ( data[Value] );
ALLEXCEPT (
data;
data[year];
data[Branch];
data_segmento_anual[Bond];
data_segmento_anual[Group];
data_segmento_anual[Type]
)
)
The other way to do it is to use ALL to specify the column that you want to be ignored.
CALCULATE ( MAX ( data[Value] ); ALL ( data[Company] ) )
Kalpavruksh Technologies | Microsoft Gold Partner
Denmark | USA | India | Germany
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
7 years agoNot applicable
Thank you so much Kalpavruksh for assisting me in this solution. I was stuck at this and needed inputs immediately and didn't know and was not much sure if I will get any input on the same. The questions seems to be pretty complex and you solved it easily.
Again thanks much!