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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors