Forum Discussion
A function 'PLACEHOLDER' has been used in a True/False expression error in aging calculation
I am wanting to create aging bands for Inventory - for example stock shelf life 0-1 months, 1-6 months, 7-12 months 13+, but when i try the dax measure , i get the error A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Can someone help with this please and explain why this is happening?
Thank you!
PBIX here SLOB.pbix which included desired result
7 Replies
- Dangar332
Resident Rockstar
Hi, watje255_ju
In your measure threr are multiple conditions in filter expression use it in filter () function
Like
Filter (tablename, condition 1& condition 2)
Refer Here for similar solutions
- watje255_ju
Helper III
Thanks for your reply! I am not filtering the table, but a measure,
Stock On Hand with Shelf Life > 1 Month =CALCULATE([Stock On Hand],[Shelf Life Remaining] > 1) orStock On Hand with Shelf Life 1-6 Months =CALCULATE([Stock On Hand],[Shelf Life Remaining] >= 1 && [Shelf Life Remaining] <= 6)Would you mind showing the correct Dax formula in the PBIX (link above) Thanks again!- Dangar332
Resident Rockstar
Hi, watje255_ju
Try below
Month =
CALCULATE(
[Stock On Hand],
[Shelf Life Remaining] > 1
) or
Stock On Hand with Shelf Life 1-6 Months =
CALCULATE(
[Stock On Hand],
Filter (tablename,[Shelf Life Remaining] >= 1 && [Shelf Life Remaining] <= 6)
)
- watje255_ju
Helper III
Thanks again still not working properly, can you access the PBIX File?
For the first example i get the same error as noted in the original post, and the second formula doesn't return the expect values for the buckets when altering the formula for 13+ months for example, thanks again for your help
- Dangar332
Resident Rockstar
Hi, watje255_ju
Month =
CALCULATE(
[Stock On Hand],
Filter (table name, [Shelf Life Remaining] > 1)
) or
Stock On Hand with Shelf Life 1-6 Months =
CALCULATE(
[Stock On Hand],
Filter (tablename,[Shelf Life Remaining] >= 1 && [Shelf Life Remaining] <= 6)
)
- watje255_ju
Helper III
Hi, thanks for your reply, the formula isn't working as expected, I should only be getting 39,198 , not 39,809, do you know why? Thanks!!