Forum Discussion
arvindyadav
7 years agoPost Partisan
Need to use If Condition In Power BI Desktop.
Hi Team, I want to establish If condition in power bi which I have made in excel i.e, =if(Profit > Average Profit/Employee , Profit, Average Profit/Employee). So how I can make that type of form...
MFelix
7 years agoSuper User
Hi arvindyadav,
Again is a question of context, since the measure is based on the total profit value compared with the average you are getting the total profit and not the sum of the above values you need to do a SUMX statment something like this should work:
IF (
HASONEVALUE ( Table[Employee] );
IF (
SUM ( Table[Profit] )
> CALCULATE ( [Average Profit/Employee]; ALL ( Table[Employee] ) );
SUM ( Table[Profit] );
CALCULATE ( [Average Profit/Employee]; ALL ( Table[Employee] ) )
);
SUMX (
Table;
IF (
SUM ( Table[Profit] )
> CALCULATE ( [Average Profit/Employee]; ALL ( Table[Employee] ) );
SUM ( Table[Profit] );
CALCULATE ( [Average Profit/Employee]; ALL ( Table[Employee] ) )
)
)
)
Regards,
MFelix
arvindyadav
7 years agoPost Partisan
Hi MFelix,
Still not getting the correct value if I adding all value which was I sent in the screenshot that addition is
| $101,966.43 |
but here I am getting $81123395.61 which is very huge.
Thanks,
Arvind