Forum Discussion
IF Formula issue
Hi Marios,
Your calculated column works great on a row by row basis, as each column can be checked to see if vacant or not.
For aggregations, you'll need a measure. Write a new measure along the lines of:
Total SqFt = CALCULATE(SUM(Table[Unit size (sq ft)], Table[Vacant/Used] = "Vacant")
You will need to replace table with the actual table names.
Hope that helps!
Hello JoHo_BI,
Many thanks for your response. I am trying to apply your formula but it cannot accept Table[Vacant/Used] = "Vacant", as in this part of the formula it only accepts measure fields.
Any idea on how to overcome this?
- JoHo_BI8 years ago
Responsive Resident
You need to make the 'IF' calculation a calculated column for it to work.
- Anonymous8 years agoNot applicable
Can you please write the full formula including the IF calculated column you mentioned as I am not sure what you mean?
Many thanks
- JoHo_BI8 years ago
Responsive Resident
No problem.
So your if statement works fine, you just need to add the previous MEASURE:
Total Vacant SqFt = CALCULATE(SUM(Table[Unit size (sq ft)], Table[Vacant/Used] = "Vacant")
You'll just need to change the items in bold to your specific dataset columns.
If that doesn't work, could you possibly share a pbix file?