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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.