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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
watje255_ju
Helper III
Helper III

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 7
watje255_ju
Helper III
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

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)

 

)

And the same logic for 7-12 months returns the above values when I am after 309 

watje255_ju_1-1702245706730.png

Thanks again 🙂

 

watje255_ju_0-1702245503015.png

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!!

Dangar332
Super User
Super User

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 

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
) or 
Stock 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!

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)

)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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