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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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