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
JojoPBI
New Member

Use a measure in a measure

Hello,

 

I got what I think is a fairly simple need, but I can't figure out how to do it as I'm pretty new with Dax.

I have added a Measure in a dataset (which is a single value, a Max()), and I want to use it as a filter condition in another measure. Something like that :

measureB = CALCULATE(MAX(dataset[column]),dataset[column] < measureA))
 
For what I understand, it's not possible to use a measure here (getting a A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression error), so I'm trying to do something like this :
measureB = CALCULATE(MAX(dataset[column]),FILTER(dataset, [column] < measureA))) but it seems that the MAX is evaluated first as it returns null.
 
What's the syntax for that need?
 
Thank you
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

try 

measureB =
CALCULATE (
    MAXX ( FILTER ( dataset, dataset[column] < [measureA] ), dataset[column] )
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

try 

measureB =
CALCULATE (
    MAXX ( FILTER ( dataset, dataset[column] < [measureA] ), dataset[column] )
)

Exactly what I needed, thanks a lot!

Helpful resources

Announcements
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.