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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
George1973
Helper V
Helper V

Grouping subsidiary products

Hi All,

Here is a table with two product groups, actualy substituting each other. Non of the products has superiority.

 

George1973_0-1650048486700.png

Where the colored groups represent the proximity. Here is the table view:

Prod_1Prod_2Group Final
00214087561
00214142671
00273097832
00278118913
00284098294
08756002141
09783002732
09829002844
11891002783
14267002141

 

Please note that, the products in one group do not appear in another groups. The groups are somehow unique.

 

I would like to automaticaly index those groups, like given in the column "Group filter", independent from recordset lengst.

Waitinf ror your proffesional support.

 

Thanks in advance,

2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @George1973 
Please try the following

Group Final = 
VAR Prod_1Rank =
    RANKX ( 
        Products,
        Products[Prod_1],,
        ASC,
        Dense
    )
VAR Prod_2Rank =
    RANKX ( 
        Products,
        Products[Prod_2],,
        ASC,
        Dense
    )
RETURN
    MIN ( Prod_1Rank, Prod_2Rank )

1.png

View solution in original post

I think I found a problem:

 

Here are the combinations, which are not grouped vise-versa in the original recordset:

George1973_6-1650100250263.png

Meaning that:
08756 - 00214 - Couple should be also appeared in the recordset as 00214-08756 record and so on..
Am I right?
I will ask my ERP administrator to correct the records and I will check your @tamerj1 formula again.

Thanks a lot once again.

 

 

 

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @George1973 
Please try the following

Group Final = 
VAR Prod_1Rank =
    RANKX ( 
        Products,
        Products[Prod_1],,
        ASC,
        Dense
    )
VAR Prod_2Rank =
    RANKX ( 
        Products,
        Products[Prod_2],,
        ASC,
        Dense
    )
RETURN
    MIN ( Prod_1Rank, Prod_2Rank )

1.png

Hi @tamerj1 ,
The solution you've provided seems very interesting and easy. But somehow in some combinations id does not work, unfortunately. For instance:

 

George1973_0-1650097314386.png

 

This group should have the same number, but the measure generates two different indexes.. here is the cross check (the second picture)

George1973_1-1650097444891.png

As you can see right and left columns are identical in terms of content of analogs, but somehow the group index is different.

 

Here is another example:

George1973_2-1650097571434.png

 

George1973_3-1650097607882.png

 

In some cases the calculation of the index is right, like here:

George1973_4-1650097708289.png

 

George1973_5-1650097747482.png

 

I do not understand why it happens?!

 

Here is the original data:

IDPRODANALOGPRODAnalog_Group

 

 

 

 

 

 

 

 

hi @George1973 
Actually I've expected that but I did'nt have enough data to find a proper solution. 
I have some ideas on how to proceed. I'll go through the file once I'm on my PC and let you know if was able to find a solution. 

I think I found a problem:

 

Here are the combinations, which are not grouped vise-versa in the original recordset:

George1973_6-1650100250263.png

Meaning that:
08756 - 00214 - Couple should be also appeared in the recordset as 00214-08756 record and so on..
Am I right?
I will ask my ERP administrator to correct the records and I will check your @tamerj1 formula again.

Thanks a lot once again.

 

 

 

@George1973 

Ok great 👍 

Hi @tamerj1 ,
We have not updated data in the origanal ERP system, but the solution you've provided seems to be correct. Thanks a lot once again.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.