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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.