Skip to main content
cancel
Showing results for 
Search instead 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

Reply
ovonel
Post Prodigy
Post Prodigy

max(MyMeasure) doesnt work...

I have my measure:

 

DIVIDE

(

   SUM(Fact[Hours])  -   CALCULATE (SUM( Fact[Hours2]) ,  ALL(Fact) ,  Fact[Type]="D" ),

   SUM(Fact[Hours])

)

 

 

It works fine.

 

But now I want to use it in another measure to do:

 

SUM(Fact[Hours])   * MAX(MyMeasure)

 

And it doesn’t work…  Why can't I do MAX(MyMeasure)?

1 ACCEPTED SOLUTION

Hi @ovonel ,

 

As far as I know, you don't need to use MAX() to use a measure, you can use it directly in your code.

MAX() only support to use a column.

 

Measure = 
SUM(Fact[Hours])   * [MyMeasure]

 

If you want to get MAX from the measure, you can try MAXX().

 

Measure = 
SUM ( Fact[Hours] ) * MAXX ( VALUES ( 'TableName'[KeyColumn] ), [MyMeasure] )

 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

MAX of mymeasure in which dimension?

I have a fake "Measures" table where I store all my measures.

 

(I created it using DATATABLE, this approach was recommended from sqlbi website)

Hi @ovonel ,

 

As far as I know, you don't need to use MAX() to use a measure, you can use it directly in your code.

MAX() only support to use a column.

 

Measure = 
SUM(Fact[Hours])   * [MyMeasure]

 

If you want to get MAX from the measure, you can try MAXX().

 

Measure = 
SUM ( Fact[Hours] ) * MAXX ( VALUES ( 'TableName'[KeyColumn] ), [MyMeasure] )

 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Fabric Community Conference

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.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

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