Forum Discussion

AteeqSundhu's avatar
AteeqSundhu
Frequent Visitor
2 years ago
Solved

Extract Maximum number against same row from data in multiple columns

I have a dataset wherein i want to calculate maximum amount from multiple columns against a single day/product/etc. Result in last column below; ProductID Salary Income Other Income Gross Pro...
  • Ahmedx's avatar
    2 years ago

    pls try this

    the first option is if you have measures in your columns

     

    RESULT= 	
    MAXX (
    { [Salary],[Income],[Other Income],[Gross Profit],[Present Salary]},[Value])
    ------
    	
    RESULT= 
    VAR _t1 = CALCULATE(SUM('yourtable'[Salary]))
    VAR _t2 = CALCULATE(SUM('yourtable'[Income]))
    VAR _t3 = CALCULATE(SUM('yourtable'[Other Income]))
    VAR _t4 = CALCULATE(SUM('yourtable'[Gross Profit]))
    VAR _t5 = CALCULATE(SUM('yourtable'[Present Salary]))
    RETURN
    MAXX (
    { _t1,_t2,_t3,_t4,_t5},[Value])