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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

evaluating and counting occurrences of specific values of a measure

Hi Everyone, thanks in advance for your kind support.

I'm fairly new to PBI, and trying to figure out the following:

- working with NBA statistics for Michael Jordan, I want to COUNT the number of titles he has won.

- the data table I have lists all statistics (pts, fg, playoff_stage,game id, w_or_l etc)

- I have created measures to count the total number of games, total W or total L. 

- Now I'm stuck in evaluating with a measure or other way how many titles MJ has won (the result if 6 out of 6 participations in NBA finals).

 

season idwinslossestotal games in final
7415
8426
9426
11426
12426
13426

 

The above is thre resulting visual matrix created in PBI adding the relevant fields:

Season_id is the nth season MJ played in NBA (values store in a lookup table with relationship to the fact/data table).

Wins, Losses and total games in final, are measures calculated from a data table

e.g. Wins := 

COUNTX(FILTER(jordan_playoffs,jordan_playoffs[playoff_stage] = "NBA Final"),PO_measure_list[mj po W])
where jordan_playoffs is the data table.

 

 

Since we know that 4W = Nba champ, I'd like to count that automatically, as I want to add also statistics for other players and make some comparisons among them. 

 

If I have not made myself clear, I apologise and will try to clarify.

 

Happy sunday to all of you.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

The basic concept would be to iterate over seasons and count when wins = 4.

ChampSeasons =
COUNTROWS (
    FILTER (
        VALUES ( jordan_playoffs[season] ),
        [Wins] = 4
    )
)

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you Alexis, it was easier than expected. Inserted into my files and checked.

Will review the logic behind the piece of code to reuse it in other events.

AlexisOlson
Super User
Super User

The basic concept would be to iterate over seasons and count when wins = 4.

ChampSeasons =
COUNTROWS (
    FILTER (
        VALUES ( jordan_playoffs[season] ),
        [Wins] = 4
    )
)

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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