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

Bottom 5 customers for profit but sales should be greater than 100K

Hi Community,

 

I have to find lowest customers profit and i have a condition that sales should be greathan 100k.

 

Bottom 5 customers for profit but sales should be greater than 100K.

 

Please help.

 

Thanks,

Paruchuri

1 ACCEPTED SOLUTION

@Anonymous add new rank column as below and then you can filter on this column

 

Rank = IF( [Sales] > 100, RANKX( FILTER( Table1, Table1[Sales] > 100 ), Table1[Profit %], , ASC,Dense ) )

Here is the output 

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

10 REPLIES 10
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may refer to the post below.

https://community.powerbi.com/t5/Desktop/RANKX-excluding-blanks/m-p/397656#M181491

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-chuncz-msft  It doesn't give me the expected result. I would like to create the measure first it should check the sales >100 and from that it would give the bottom 5 Profit. 

 

I have created the customer rank formula as 

Customer Rank =
IF (
([Sales >100K]>100),
RANKX (
FILTER ( ALLSELECTED ( [CustName] ), ( [Sales >100K] >100) ),
[Sales >100K]
)
)


I would need like below.

 

INPUT

Capture.JPG

Thanks/

@Anonymous this post will help, but if you still cannot figure out, please share data in excel using onedrive/google drive to get your answer quickly. Remove any sensitive information before sharing.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I tried it but not working. I have pasted the excel sheet.

 

https://1drv.ms/f/s!AjL_xzhqwRM-wxss_RQr9e1vMspj

 

 

@Anonymous add new rank column as below and then you can filter on this column

 

Rank = IF( [Sales] > 100, RANKX( FILTER( Table1, Table1[Sales] > 100 ), Table1[Profit %], , ASC,Dense ) )

Here is the output 

 

image.png



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

The formula is working fine but i'm getting only 1,2 ranks. 

@Anonymous if you see my output it is working as expected, I'm not sure what is your dataset, are you using measures etc etc



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

The sales and profits are measures. 

@Anonymous add my DAX expression as measure instead of column as I suggested before, 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

i created measure only.

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.