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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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