Forum Discussion
arvindyadav
Post Partisan
7 years agoNeed 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...
arvindyadav
Post Partisan
7 years agoHi MFelix,
Please find the sample file.
https://www.dropbox.com/s/liep5krpxcebyvh/Sample.xlsx?dl=0
Thanks,
Arvind
MFelix
Super User
7 years agoHi arvindyadav,
Create the following two measures:
Profict per employee =
IF (
SUM ( Sheet1[Profit] )
> CALCULATE ( AVERAGE ( Sheet1[Profit] ); ALL ( Sheet1[AM] ) );
SUM ( Sheet1[Profit] );
CALCULATE ( AVERAGE ( Sheet1[Profit] ); ALL ( Sheet1[AM] ) )
)
Total Profit =
IF (
HASONEFILTER ( Sheet1[AM] );
[Profict per employee];
SUMX (
SUMMARIZE (
ALL ( Sheet1 );
Sheet1[Date].[Month];
Sheet1[AM];
"ProfitTotal"; [Profict per employee]
);
[ProfitTotal]
)
)
The use the second one to add to your visual should work, see attached PBIX file.
Regards,
MFelix