Forum Discussion
Replicating an IF statement to create Column with multiply and divide within on Power BI
- 2 years ago
Ah, I see. It's because you're trying to escape a number value to a text value.
For a calculated column, this should work:
Unsecured W Average [column] = IF( DATA[Loan Type] = "Status", DATA[Deposit Amount] * (DATA[Annual Interest] / 12) )Pete
Hi sbarker_11 ,
1st approach :
Try this measure :
Measure =
CALCULATE(
SUMX (DATA, DATA[Deposit Amount]) * (DATA[Annual Interest]) /12),
DATA[LOAN TYPE] = "STATUS"
)
Another approach:
If you
1. create a column in the table data named IsLoanType_Status where IF ( Data[Loan Type] = "Status", 1 ,0 )
Then,
2. Create a measure:
SUMX (DATA, DATA[Deposit Amount]) * (DATA[Annual Interest]) /12)
3. On the visual containing the measure above, add the IsLoanType_Status is 1.
Please share sample data removing any sensitive information in case this doesn't resolve the issue.
Hi, this makes sense but when I have tried approach 1, i get the following error, maybe it needs summing? :
"A single value for column 'Annual Interest' in table 'DATA' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."