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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bw70316
Helper V
Helper V

New Column For Champion Based on Year

The champion in this case is the 75 Sabres for having attained 4 wins in the Final Round. How do I create a separate column declaring the team with 4 total wins in the final round the champion?

 

Something like... If(Calculate(Sum(Database[Win]), Database[Round] = "final") = 4 for a given year, then Champion, N/A)

 

 

It's how to get that 4 for a given year in there that is given me an issue. Any thoughts? The Chart is below for any reference. 

 

YearGameTeamOpponentWinLossTieStageRound
20056775 Sabres82 Islanders 1 R16Final
20056782 Islanders75 Sabres1  R16Final
20056475 Sabres82 Islanders1  R16Final
20056482 Islanders75 Sabres 1 R16Final
20056375 Sabres82 Islanders 1 R16Final
20056382 Islanders75 Sabres1  R16Final
20056975 Sabres82 Islanders1  R16Final
20056982 Islanders75 Sabres 1 R16Final
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@bw70316 try this measure (NHL Fan) 🏒🏒

 

Measure = 
VAR __wins = CALCULATE ( SUM ( Table[Wins] ), ALLEXCEPT ( Table, Table[Team] ), Table[Round] = "Final" )
RETURN
IF ( __wins = 4, "Champion", "N/A" )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@bw70316 try this measure (NHL Fan) 🏒🏒

 

Measure = 
VAR __wins = CALCULATE ( SUM ( Table[Wins] ), ALLEXCEPT ( Table, Table[Team] ), Table[Round] = "Final" )
RETURN
IF ( __wins = 4, "Champion", "N/A" )

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

That solution worked, but I'm trying to have one row for champion for each year. Or I could do something like Final Wins - Final Losses where 

Final Wins = CALCULATE(Sum(Database[Win]), Database[Round] ="final")
and Final Losses =  CALCULATE(Sum(Database[Loss]), Database[Round] ="final")
 
and do something like IF(Final Wins> Finals Losses, "Champion", ) but I still need to break it down by year in some fashion for teams that have more final L's in different years. Thanks for taking time to look at this

 

200613196 Panthers06 France 1 R16FinalO396 Panthers06 FranceN/A 
200612996 Panthers06 France 1 R16FinalO106 France96 PanthersN/A 
200612906 France96 Panthers1  R16FinalO106 France96 PanthersChampion
20056882 Islanders75 Sabres 1 R16FinalO675 Sabres82 IslandersN/A 
20056875 Sabres82 Islanders1  R16FinalO675 Sabres82 IslandersChampion
20056775 Sabres82 Islanders 1 R16FinalO582 Islanders75 SabresChampion
20056782 Islanders75 Sabres1  R16FinalO582 Islanders75 SabresN/A 
20056682 Islanders75 Sabres1  R16FinalO475 Sabres82 IslandersN/A 

@bw70316 In ALLEXCEPT funtion, add year into it, that will work by year.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

champion = VAR __wins = CALCULATE ( SUM ( Database[Win] ), ALLEXCEPT (Database, Database[Team], Database[Year]), Database[Round] = "Final") Return If(__wins = 4, "Champion", "N/A")
 
Do you mean like this above? It yielded the same results in that I have several champions or a N/a for each finals grouping. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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