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
ajinkya1907
Helper II
Helper II

Calculate count of rows

Hi,

 

I am having below dataset

Match_Dashboard.JPG

 

I would like to identify number of matches played by every winning team. Please note winning team can be part of Team 1 OR team 2. So if I calculate number of times winner appears in the team1 or team2, I should get the answer.

 

I am looking for Match_count field of below dashboard

Dashboard.JPG

2 ACCEPTED SOLUTIONS

Dear @Zubair_Muhammad, Thanks again for your help. It's indeed almost perfect solution 🙂

 

I made minor changes as I could not get SELECTEDVALUE function. Rest is all good.

 

Match Count of Winner Team =
VAR winnerteam =
    SELECTCOLUMNS( matches,"winner2",matches[winner])
RETURN
    CALCULATE ( COUNTROWS ( ALLSELECTED ( Matches ) ), Matches[Team1] = winnerteam )
        + CALCULATE ( COUNTROWS ( ALLSELECTED ( Matches ) ), Matches[Team2] = winnerteam )

View solution in original post

HI @ajinkya1907

 

Try this MEASURE

 

Median = MEDIANX(ALLSELECTED(matches[winner]),[Matches Played])

Regards
Zubair

Please try my custom visuals

View solution in original post

11 REPLIES 11

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.