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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AteeqSundhu
Frequent Visitor

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;

ProductIDSalaryIncomeOther IncomeGross ProfitPresent Salary

RESULT

(MAX Value Needed)

ABCD1000

1800

0750021007500
DEFG200

7500

NUL

11009557500
HIJK600012000 85032512000
KLKM50097005000975088509750
1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

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])

 

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User

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])

 

@Ahmedx Thanks for the reply it worked very well, however if I use same formula to extract MAX out of some other numeric data columns then it shows below message

"A circular dependency was detected: DC061123[DR_LIMIT], DC061123[Inflow], DC061123[DR_LIMIT]."

Formula Used

RESULT1=
VAR _t1 = CALCULATE(SUM('yourtable'[DR_Turnover]))
VAR _t2 = CALCULATE(SUM('yourtable'[DR_Tunover1]))

RETURN
MAXX (
{ _t1,_t2},[Value])

 

kindly guide

pls share the file so we can help you

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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