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
bjurek
Helper I
Helper I

difficult grouping in "dax"

Hello everyone, I have a problem with the following issue. I have tables in "dax" with three columns. I would like to show only customers who ordered a minimum of 10 cars of the same color. Under conditions: The last 10 orders are the same color of the car. So 1 car is the same as 2 and 3 up to a minimum of 10. It follows from the above that only two clients meet the above-mentioned conditions. Customer A - The last 12 orders are Blue Car Customer D - the last 23 orders are blue cars. The other two clients do not meet the conditions because: Customer B - there are 2 different cars in the last 10 orders Client C - did not complete at least 10 orders Please, suggest how to approach the topic.

 

The result should be something like this

 

Customer A

| BLUE CAR

| 11

Customer D

| BLUE CAR

| 23

 


data:

CLIENTITEMDATE

Client A | BLUE CAR | 13.09.2021
Client A | BLUE CAR | 12.09.2021
Client A | BLUE CAR | 11.09.2021
Client A | BLUE CAR | 10.09.2021
Client A | BLUE CAR | 09.09.2021
Client A | BLUE CAR | 08.09.2021
Client A | BLUE CAR | 07.09.2021
Client A | BLUE CAR | 06.09.2021
Client A | BLUE CAR | 05.09.2021
Client A | BLUE CAR | 04.09.2021
Client A | BLUE CAR | 03.09.2021
Client B | BLUE CAR | 13.09.2021
Client B | BLUE CAR | 12.09.2021
Client B | BLUE CAR | 11.09.2021
Client B | BLUE CAR | 10.09.2021
Client B | RED CAR | 13.09.2021
Client B | BLUE CAR | 12.09.2021
Client B | BLUE CAR | 11.09.2021
Client B | BLUE CAR | 10.09.2021
Client B | BLUE CAR | 09.09.2021
Client B | BLUE CAR | 08.09.2021
Client B | BLUE CAR | 07.09.2021
Client B | BLUE CAR | 06.09.2021
Client B | BLUE CAR | 05.09.2021
Client B | BLUE CAR | 04.09.2021
Client D | BLUE CAR | 13.09.2021
Client D | BLUE CAR | 12.09.2021
Client D | BLUE CAR | 11.09.2021
Client D | BLUE CAR | 10.09.2021
Client D | BLUE CAR | 09.09.2021
Client D | BLUE CAR | 08.09.2021
Client D | BLUE CAR | 07.09.2021
Client D | BLUE CAR | 06.09.2021
Client D | BLUE CAR | 05.09.2021
Client D | BLUE CAR | 04.09.2021
Client D | BLUE CAR | 03.09.2021
Client D | BLUE CAR | 02.09.2021
Client D | BLUE CAR | 01.09.2021
Client D | BLUE CAR | 31.08.2021
Client D | BLUE CAR | 30.08.2021
Client D | BLUE CAR | 29.08.2021
Client D | BLUE CAR | 28.08.2021
Client D | BLUE CAR | 27.08.2021
Client D | BLUE CAR | 26.08.2021
Client D | BLUE CAR | 25.08.2021
Client D | BLUE CAR | 24.08.2021
Client D | BLUE CAR | 23.08.2021
Client D | BLUE CAR | 22.08.2021
3 REPLIES 3
Anonymous
Not applicable

Hi,

Im working in a solution for this problem, but i have a question. Why does Client B not meet the conditions? He has bought only blue cars and more than ten. 

Regards,

Marc

Hello Mark,

 

i made mistake with name of client.

before

 

Client C | RED CAR | 13.09.2021

 

after correct:

 

Client B | RED CAR | 13.09.2021
amitchandak
Super User
Super User

@bjurek , to me it seem like Continuous Streak problem. Refer if this can help

 

https://stackoverflow.com/questions/57603253/counting-consecutive-fails-in-test-results-in-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.