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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
LycanWW
New Member

Count numbers of measures occurence

Hi,

 

This is my first post so I hope I will do things correctly.

I have a formula 1 championship with different seasons. Each of them has a winner. I have a table "Resultats" with the position of every pilot and the points he has earned. With that, I have created two measures which summarize the total of points and the ranking.

So I can have, by season, the total of points and the ranking for each pilot.

Now I would have the number of championships won by the pilot.

 

 

I try to do the differents things below but I get each time the total numbers of seasons

 

LycanWW_0-1653072334188.png

LycanWW_1-1653072435360.png

Maybe it's very easy but I can't find the answer...

 

Thanks for your help,

Best regards

5 REPLIES 5
LycanWW
New Member

Hi @v-easonf-msft,

 

Sorry if I was not clear enough in my explanation.

The result I want would be, for one pilot, to know how much championship he has won. So if I take the Formula One for exemple, I would like to choose Lewis Hamilton and have the result that he has won 7 championships.

 

And yes I have a field "ID" to identify every pilot.

 

When I take your solution, it gives me the number of championships in which my pilot has participated :

LycanWW_0-1653397069569.png

 

In fact, it seems that it does not take into account the filter. Maybe the problem is in my relational schema ?

 

Sorry, I'm a beginner in Power BI so thanks a lot for your help.

 

@ribisht17 my data-set is a little bit personnal. I could share the architecture but without the data. Don't know if it is possible...

 

Hi, @LycanWW 

Can you show the formula for the [classment] you are currently using?

Will it be affected by the filter? If possible, please share a sample file without any sensitive data.

Nbre championat =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            Resultats,
            resultats[Saison],
            resultats[pilot],
            "Value", CALCULATE ( [Classement], ALLSELECTED ( Resultats ) )
        ),
        [value] = 1
    )
)

 

Best Regards,
Community Support Team _ Eason

Hi @v-easonf-msft,

 

Thanks for your answer.

My "classement" formula is as follow :

Classement = 
    RANKX(
        ALL( Pilotes ),
        [Total Points],
        ,
        DESC
    )

I will send you my data file by private message.

 

Thanks for your help,

Best regards

v-easonf-msft
Community Support
Community Support

Hi, @LycanWW 

Not fully sure what you want. Can you share your expected result?

Do you have a field to identify each pilot? Try adding the field in the function ‘summarize’.

 

Nbre championat =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            Resultats,
            resultats[Saison],
            resultats[pilot],
            "Value", [Classement]
        ),
        [value] = 1
    )
)

 

Best Regards,
Community Support Team _ Eason

 

ribisht17
Super User
Super User

@LycanWW 

 

Please post data-set to get the answers

 

Thanks,

Ritesh

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.