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
eravelo
Frequent Visitor

Compare diferent rows and show the common values

Hi, I have a dataset that is an append of 3 different datasets (each corresponding to one zone, America, Europe and Asia)

 

The dataset is something like this:

 

Month     Zone      Vendorcode       Vendor        Values1   Values2      Values3
Jan           Asia            0001             Vendor1           1              0               0
Jan           Asia            0001             Vendor1           1              1               1
Jan        America         0001             Vendor1           0              1               0
Jan         Europa          0002             Vendor2           1              1               1
Jan         Europa          0002             Vendor2           1             1                1
Jan        America        0001              Vendor1           1             0                 0
Feb           Asia           0003              Vendor3           0             1                 0 
Feb          Asia            0001               Vendor1          0             1                 0
Feb         America        0001              Vendor1          0            1                 0
Feb           Europa        0002              Vendor2          0            0                  0
Feb           Europa        0001              Vendor1         1            1                  1
Feb          America       0002               Vendor2         1            1                  1
March        Asia           0003               Vendor3        1              0                   0
March         Asia           0001              Vendor1         1             1                  1
March       America        0002             Vendor2        1              1                  1
March        Europa         0001             Vendor1         1             1                  1
March        Europa           0003             Vendor3       1             1                  1
March        America          0002             Vendor2      1             1                  1


I need to compare the diferent rows by vendor and zone so if for example the vendor 1 appears in asia, europe and america, i need it to appear in a table with the sumarized values from the table and depending on the selected filters. but if vendor 2 is not in all the zones it will not appear in the table. 

 

by the example table the expecting result is something like this: 

 

VendorcodeVendorValues1Values2Values3
0001Vendor10.666666670.777777780.44444444
0003Vendor30.750.75

0.5

 

Do you have any idea of how to do that?

 

Thanks

1 ACCEPTED SOLUTION

@eravelo

At first, create a calculated table and link those two tables with proper relationship.

 

Zone Table = DISTINCT(yourTable[Zone])

 

Capture.PNG

 

Then create those measures

isContainsAllSelectedZones = 
VAR selectedZones = CONCATENATEX(ALLSELECTED('Zone Table'[Zone]),'Zone Table'[Zone],",",'Zone Table'[Zone])
VAR vendorZones = CONCATENATEX(VALUES(yourTable[Zone]),yourTable[Zone],",",yourTable[Zone]) 
RETURN selectedZones=vendorZones

average of val1 = IF([isContainsAllSelectedZones],AVERAGE(yourTable[Values1]),BLANK())

average of val2 = IF([isContainsAllSelectedZones],AVERAGE(yourTable[Values2]),BLANK())

average of val3 = IF([isContainsAllSelectedZones],AVERAGE(yourTable[Values3]),BLANK())

Capture.PNG

 

See more details in the attched pbix file.

View solution in original post

3 REPLIES 3
eravelo
Frequent Visitor

Hello, I have a dataset that is an append of 3 different datasets (one for each zone, America, Asia and Europe), the table looks something like this:

 

Spoiler
MonthZoneVendorcodeVendorValues1Values2Values3
JanAsia0001Vendor1100
JanAsia0001Vendor1111
JanAmerica0001Vendor1010
JanEuropa0002Vendor2111
JanEuropa0002Vendor2111
JanAmerica0002Vendor1100
FebAsia0003Vendor3010
FebAsia0001Vendor1010
FebAmerica0001Vendor1010
FebEuropa0002Vendor2000
FebEuropa0001Vendor1111
FebAmerica0002Vendor2111
MarchAsia0003Vendor3100
MarchAsia0001Vendor1111
MarchAmerica0002Vendor2111
MarchEuropa0001Vendor1111
MarchEuropa0003Vendor3111
MarchAmerica0003Vendor3111

what i need to do is compare the diferent rows so if for example vendor 1 apears in europe, asia and america, then it will appear in a table on the dashboard with its different values summarized (in average for example) and filter by the possible filters in the dashboard. But if vendor 2 appears in 2 zones instead of all of them then vendor 2 is not going to appear in the table.

 

the expected table should be something like this: 

 

Spoiler
VendorcodeVendorValues1Values2Values3
0001Vendor10.666666670.777777780.44444444
0003Vendor30.750.750.5

Do you have any Idea of how to do this?  if you think that some reference colums could be added and how to use them... please let me know... 

 

Thank you a lot!

@eravelo

At first, create a calculated table and link those two tables with proper relationship.

 

Zone Table = DISTINCT(yourTable[Zone])

 

Capture.PNG

 

Then create those measures

isContainsAllSelectedZones = 
VAR selectedZones = CONCATENATEX(ALLSELECTED('Zone Table'[Zone]),'Zone Table'[Zone],",",'Zone Table'[Zone])
VAR vendorZones = CONCATENATEX(VALUES(yourTable[Zone]),yourTable[Zone],",",yourTable[Zone]) 
RETURN selectedZones=vendorZones

average of val1 = IF([isContainsAllSelectedZones],AVERAGE(yourTable[Values1]),BLANK())

average of val2 = IF([isContainsAllSelectedZones],AVERAGE(yourTable[Values2]),BLANK())

average of val3 = IF([isContainsAllSelectedZones],AVERAGE(yourTable[Values3]),BLANK())

Capture.PNG

 

See more details in the attched pbix file.

Hi,

 

You may refer to my solution here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors