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

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

Reply
Anonymous
Not applicable

Display pair once in table

Hi all,

 

I have the following data and I need to display them in a table visualization.

A B Counts
user1 user2 2
user2 user1 2
user3 user1 1
user1 user3 1

 

I would like to display each pair (e.g. user1, user2) only once and skip (user2, user1 pair)

I would greatly appreciate any suggestion.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

First create an index column in query editor;

Then create 2 columns as below:

Column = 'Table'[A]&'Table'[B]
Column 2 = 'Table'[B]&'Table'[A]

Then create a measure as below:

Measure = 
 var _previous=CALCULATE(MAX('Table'[Column]),FILTER(ALL('Table'),'Table'[Index]<MAX('Table'[Index])))
 Return
IF(_previous=MAX('Table'[Column 2]),BLANK(),MAX('Table'[Counts]))

And you will see:

v-kelly-msft_0-1618387370693.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

First create an index column in query editor;

Then create 2 columns as below:

Column = 'Table'[A]&'Table'[B]
Column 2 = 'Table'[B]&'Table'[A]

Then create a measure as below:

Measure = 
 var _previous=CALCULATE(MAX('Table'[Column]),FILTER(ALL('Table'),'Table'[Index]<MAX('Table'[Index])))
 Return
IF(_previous=MAX('Table'[Column 2]),BLANK(),MAX('Table'[Counts]))

And you will see:

v-kelly-msft_0-1618387370693.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

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

 

Anonymous
Not applicable

Brilliant! Thanks @v-kelly-msft 

amitchandak
Super User
Super User

@Anonymous , This measure along with A and B will only give first combination

calculate(counrows(Table), filter(Table, Table[A] = "User1" && Table[B] = "User2"))

 

And this measure will not give the  second combination

 

calculate(counrows(Table), filter(Table, not(Table[A] = "User2" && Table[B] = "User1")))

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
Anonymous
Not applicable

@amitchandak  thank you for your quick response.

Unfortunately, based on your suggestion I have to create a measure for each pair.

I have a large dataset, full of such pairs. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors