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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors