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...
MFelix
Super User
7 years agoHi arvindyadav,
Replace the first measure by:
Profict per employee =
IF (
SUM ( Sheet1[Profit] ) = BLANK ();
BLANK ();
IF (
SUM ( Sheet1[Profit] )
> AVERAGEX (
SUMMARIZE (
ALL ( Sheet1 );
Sheet1[Date].[Month];
Sheet1[AM];
"ProfitTotal"; SUM ( Sheet1[Profit] )
);
[ProfitTotal]
);
SUM ( Sheet1[Profit] );
AVERAGEX (
SUMMARIZE (
ALL ( Sheet1 );
Sheet1[Date].[Month];
Sheet1[AM];
"ProfitTotal"; SUM ( Sheet1[Profit] )
);
[ProfitTotal]
)
)
)
See attach the correct PBIX file.
Regards,
MFelix
arvindyadav
Post Partisan
7 years agoHi MFelix,
Not works. For every month and individual month, the total is the same.
Please find attached.
- MFelix7 years ago
Super User
- arvindyadav7 years ago
Post Partisan
No
- MFelix7 years ago
Super User
Hi arvindyadav,
As I refer this calculation are based on context so if your model setup is different then the final result will not match what you need.
Can you share a mockup of your model so I can make the right adjustment to the formulas?
If you want you can share it trhough private message to avoid publishing sensitive data.
Regards,
MFelix