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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
FVM411
Frequent Visitor

Assessing the max of two lines in DAX

Hi everyone, 

Im a beginner on power bi and dax and I've been struggling on a subject of my own. 

I was parsing the polls for 2024 and decided to make a data analysis subject about it. 

Unfortunately the answer to my question didn't exist as I searched on various forums. 

 

So, I need to calculate the maximum of two lines as per the image below. 

I thought about storing the values for each question poll in a variable but thing is, i don't think it is possible since power bi read 

each row. 

Would anyone have any ideas? Best regards

 data poll.JPG

5 REPLIES 5
FVM411
Frequent Visitor

I would like to have the candidate name with the highest percent for each question_id poll over 2 or 3 rows

Hi, @FVM411 

try below

winner =
var name = table[candidate name]
var percentage = table[percantage]
var curr_qu_id = table[question_id]
return
Minx(
 filter(
    table,
    table[question_id] = curr_qu_id
),
 name &" "& percentage
)

Thank you for your answer but it doesn't work, i get the same result. capture 2.JPG

FVM411
Frequent Visitor

data poll.JPG

 

hi, @FVM411 

clarify what is your expected output or what you want?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.