Forum Discussion
New Conditional Column Calculation based on (non-value) other column entry
- Anonymous4 years ago
Hi Anonymous ,
Based on the calculation logic provided in your screenshot (Columns J and K), it seems that the calculation logic you describe and the calculation results do not match. If the values in column J are correct, then the calculation logic should be as follows:
If Level = "Junior", then it is (Sales Rev1+Sales Rev2+Sales Rev3)*2;
If Level = "Exec", then it is (Sales Rev1+Sales Rev2+Sales Rev3+Sales Rev4)*3;
If it is other level, it is 0.
If my understanding above is correct, you can create the following calculated column or measure to get the Bonus... Please find the details in the attachment.Calculated column:
Bonus = VAR _srev = 'Table'[Sales Rev1] + 'Table'[Sales Rev2] + 'Table'[Sales Rev3] VAR _srefrev = 'Table'[Sales Rev1] + 'Table'[Sales Rev2] + 'Table'[Sales Rev3] + 'Table'[Sales Rev4] RETURN SWITCH ( 'Table'[Level], "Junior", _srev * 2, "Exec", _srefrev * 3, 0 )Measure:
Measure_Bonus = VAR _srev = SUM ( 'Table'[Sales Rev1] ) + SUM ( 'Table'[Sales Rev2] ) + SUM ( 'Table'[Sales Rev3] ) VAR _srefrev = SUM ( 'Table'[Sales Rev1] ) + SUM ( 'Table'[Sales Rev2] ) + SUM ( 'Table'[Sales Rev3] ) + SUM ( 'Table'[Sales Rev4] ) RETURN SWITCH ( SELECTEDVALUE ( 'Table'[Level] ), "Junior", _srev * 2, "Exec", _srefrev * 3, 0 )Best Regards
Hi Anonymous
You may start with presenting sample of your source data and then build on it your expected result. Power Bi works in a different way than excel does therefore, it is better that first you clearly define the starting point along with the expected outcome then you can provide more details about how the numbers are calculated.