Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not 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 shown as below.

ilyan321_1-1635480082401.png

Hereby I attach the 3 steps table for your reference:

Table1: 

 

forecasting_uoa_payroll_step1 = 
    FILTER (  
        uoa_payslips_history_aggregated,
        DATEDIFF(uoa_payslips_history_aggregated[YearMonth],TODAY(),MONTH)<variable_uoa_per_cust_window[Variable_UoA_per_Cust_Window Value]+1
    )

 

Table 2:

 

forecasting_uoa_payroll_step2 = 
    SUMMARIZE ( 
        forecasting_uoa_payroll_step1, 
        forecasting_uoa_payroll_step1[Country],
        "UoA Per Customer Average", AVERAGE(forecasting_uoa_payroll_step1[UoA_per_Customer])
    )

 

Table 3: 

 

forecasting_uoa_payroll_step3 = 
	SELECTCOLUMNS ( 
		customer_payroll_forecast,
		"Date", customer_payroll_forecast[YearMonth],
		"Country", customer_payroll_forecast[Country],
		"Customers", customer_payroll_forecast[Total Headcount]
	)

 

Thank you

 

12 REPLIES 12
KramGemm
Frequent Visitor

I'm having the same issue.  I'm guessing there hasn't been a fix found?

mgb-nav-pbi
Advocate I
Advocate I

I don't know if this issue was solved or not, but just to keep in mind for these kind of situations,  we can not use both measures to check the boolean condition in the filter argument.

The following article explains the issue in detail. 
https://p3adaptive.com/2012/06/filter-when-why-how-to-use-it/

If this helps 🙂

Thank you @mgb-nav-pbi, mine issue also got resolved because of above link. 👍

Thank you mgb-nav-pbi for sharing this link!
It solved a simialr issue I have been facing!
Kudos to you!

Thanks "mgb-nav-pbi", your linked article has solved my issue,
whereby I got the same error, when uing a measure in a CALCULATE expression as a filter,
e.g. measure < 155.
Just putting the FILTER function in front of the measure has solved my issue,
e.g. FILTER(measure < 155)

 

Rooms < $155 = CALCULATE(
    SUM('Invoice'[Room Count]),

    'Invoice Line'[Item Group]="HOTEL",

    FILTER ([measure] < 155)
)

Worked for me too, thanks!

 

FILTER() works. Thanks!

This is great, I was stuck with this issue for some days and this solution (FILTER) actually worked.

 

Thanks!

This worked for me inside a calculate statment, anyone know the logic as to why this works? what is filter doing behind the scenes?

PaulOlding
Solution Sage
Solution Sage

Hi @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:

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
elainepowell
Frequent Visitor

I just ran into the same error and found your question.
If I find the answer anywhere else, I'll post.

Anonymous
Not applicable

Thank you! Im still searching for it too, will reply here if I found any

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Top Solution Authors