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
Anonymous
Not applicable

How to count drop in trip

Could anyone help recommend formula please. For example, I would like to count distinct Store name by trip and also provide ranking as in count drop column. Thank you.

Trip no.Store nameCount drop
Trip1A1
Trip1B2
Trip2A1
Trip2B2
Trip2C3
1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Incase you want a Calculated Column

 

count1 drop = 
RANKX (
    FILTER (
        RankDrop,
        'RankDrop'[Trip no.]
            = EARLIER ( 'RankDrop'[Trip no.] )
    ),
    'RankDrop'[Store name] ,,ASC
)

 

1.jpg
 
 
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

6 REPLIES 6
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Incase you want a Calculated Column

 

count1 drop = 
RANKX (
    FILTER (
        RankDrop,
        'RankDrop'[Trip no.]
            = EARLIER ( 'RankDrop'[Trip no.] )
    ),
    'RankDrop'[Store name] ,,ASC
)

 

1.jpg
 
 
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

For my test , maybe you used the formula for "New Column" . It is used for "New measure".

8.14回8.13.PNG

Best regards,

Eyelyn Qin

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

According to my understanding, you want to rank based on two columns , right?

You could use the following formula:

count drop =
RANKX (
    FILTER ( ALL ( RankDrop ), 'RankDrop'[Trip no.] = MAX ( 'RankDrop'[Trip no.] ) ),
    CALCULATE ( MAX ( ( 'RankDrop'[Store name] ) ) ),
    ,
    ASC
)

My visualization looks like this:

8.13.3.PNG

Is the result what you want? If not, please upload some detailed data samples and expected output.

Please do mask sensitive data before uploading.

 

Best Regards,

Eyelyn Qin

Anonymous
Not applicable

I have try on your formula but there is alert shown "A circular dependency was detect"

pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

Calculate(DISTINCTCOUNT(table[store_name]), allexcept(table, table[trip_id))

For rank you can refer to the video 

https://www.youtube.com/watch?v=3u0WJFKxGJk

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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