Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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 i...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    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.