Forum Discussion
Anonymous
4 years agoNot applicable
DAX Error: A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table
Hi, I am new to DAX. I have an assignment which requires me to convert all 3 steps tables to only one table using CALCULATETABLE function. When i tried to do for the first 2 steps, there is an error ...
PaulOlding
Solution Sage
4 years agoHi Anonymous I'm finding it hard to understand what you're trying to acheive. To help with your wider goal it would be useful if you can post a picture of your model and provide some sample data in table format, or share the .pbix if you can.
A high-level description of what you're trying to do would help as well.
Some general comments on the code that may help you:
- Is the uoa_payslips_history_aggregated[YearMonth] column a date or datetime type? It needs to be to use the DATEDIFF function
- Best practice is to not use SUMMARIZE to add columns. See https://www.sqlbi.com/articles/all-the-secrets-of-summarize/
You could refactor step 2 as
forecasting_uoa_payroll_step2 =
ADDCOLUMNS(
VALUES(forecasting_uoa_payroll_step1[Country]),
"UoA Per Customer Average", CALCULATE(AVERAGE(forecasting_uoa_payroll_step1[UoA_per_Customer]))
)
- However, I don't understand why you're doing that step. Using this as a filter in CALCULATE/CALCULATETABLE isn't going to have any effect. You calculate an average but then do nothing with it. What are you trying to do here?
- It also references this: forecasting_uoa_payroll_step1. Does that exist now you've combined step1 and step 2 together?
- You say the ultimate aim is to create one table, but I don't see how Step 2 and Step 3 are in any way related