cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper II

## 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
Helper II

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

Memorable Member

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)

)

Helper II

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

Thanks again 🙂

Helper II

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

Memorable Member

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

Helper II

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

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)

)

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors