Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculated column using MAXX with multiple calculations as expression

Hi peeps,

I have 3 columns in my table with each containing a decimal number. Now I want a column which displays a number after a calculation has been made. This column needs to display the highest number after these 3 calculations for the 3 different columns ( 1 calculation for each column) has been made.

Formula now:

PW = MAXX(Load;Load[M] * 1750 && Load[W]* 1 && Load[V] * 330)
 This doesn't work it gives me an error "function MAXX cannot work with values of type boolean. probably has something to do with the &&. Not sure how to incoporate the different calculations in MAXX. Any help would be appreciated.
so with this data:
S    |       M    |     W             |  V
1            3          2000             13
2            16        20000           4
3             11,6     24800           200

result should be:
S    |       M    |     W             |  V        | PW
1            3          2000             13        5250
2            16        29000           4           29000
3             11,6     24800           200       66000
  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous yes you are right my bad.

    Maximum = 
    VAR _m = 'Table'[M]*1750
    VAR _w = 'Table'[W]*1
    VAR _v = 'Table'[V]*330
    RETURN MAX(_m,MAX(_w,_v))

     

4 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

     

    You can try adding a column like below.

    Column = MAXX( { 'Table'[M] * 1750, 'Table'[W], 'Table'[V] * 330 }, [Value] )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 
    please try below calculated column

    Maximum = 
    VAR _m = 'Table'[M]*1750
    VAR _w = 'Table'[W]*1
    VAR _v = 'Table'[V]*330
    RETURN MAX(a,MAX(b,c))
    • Anonymous's avatar
      Anonymous
      Not applicable

      Where does the a,b,c come from? is this supposed to be _m , _W, _V?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous yes you are right my bad.

        Maximum = 
        VAR _m = 'Table'[M]*1750
        VAR _w = 'Table'[W]*1
        VAR _v = 'Table'[V]*330
        RETURN MAX(_m,MAX(_w,_v))