Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I have Indian election poll data over year as attached screenshot I want to create DAX function to find winning candidate name from dataset for specific state,year and for specific PC No.
Kindly help me out.
Solved! Go to Solution.
Hi @gurunath_1986 ,
Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Create the new measure.
Winning Candidate =
VAR MaxVotes = CALCULATE(MAX(ElectionTable[totvotpoll]), ALLEXCEPT('ElectionTable', 'ElectionTable'[state], 'ElectionTable'[year], 'ElectionTable'[pc-number]))
RETURN
CALCULATE(
MAXX(FILTER('ElectionTable', 'ElectionTable'[totvotpoll] = MaxVotes), 'ElectionTable'[candidate-name]),
ALLEXCEPT('ElectionTable', 'ElectionTable'[state], 'ElectionTable'[year], 'ElectionTable'[pc-number])
)
3.Drag the measure into the table visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @gurunath_1986 ,
Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Create the new measure.
Winning Candidate =
VAR MaxVotes = CALCULATE(MAX(ElectionTable[totvotpoll]), ALLEXCEPT('ElectionTable', 'ElectionTable'[state], 'ElectionTable'[year], 'ElectionTable'[pc-number]))
RETURN
CALCULATE(
MAXX(FILTER('ElectionTable', 'ElectionTable'[totvotpoll] = MaxVotes), 'ElectionTable'[candidate-name]),
ALLEXCEPT('ElectionTable', 'ElectionTable'[state], 'ElectionTable'[year], 'ElectionTable'[pc-number])
)
3.Drag the measure into the table visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
7 | |
4 | |
4 |