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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
OmarMonzer
Regular Visitor

Returning a value if cells are duplicate based on condition

Hello PBI community,

I need your help to create a column that returns only one value based on MAX Quantity, below is an example.
current data:

Condition.   Quantities.

Absd1011.          1

Absd1213.          1

Absd1314.          1

Absd1011.          1

Absd1011.         -1

 

Desired data:

Condition.   Quantities.  Duplication check. 

Absd1011.          1                 True. 

Absd1213.          1                 True. 

Absd1314.          1                 True. 

Absd1011.          1                 Blank/False. 

Absd1011.         -1                Blank/False. 

So basically i just need to return only one value for distinct "Condition" with MAX Quantity "which is usually 1 or -1".
And in case two rows met the criteria to only take one row randomly.

I was able to create the code for first part but I'm stuck in the second part which is most important for my case where i have to pick only one row randomly.

Thanks in advance:)

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

what about use the group by function in the PQ?

11.PNG12.PNG





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @OmarMonzer ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

ryan_mayu
Super User
Super User

what about use the group by function in the PQ?

11.PNG12.PNG





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

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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