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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fred31330
Advocate I
Advocate I

Multiple combinations of duplicate columns

Hello,

 

I have a table like this:

 

CityFiscal PeriodUserValueCol5Col6
A01-17User1100......
A02-17User1120......
A01-17User1100......
B03-17User1200......
A02-17User3100......
B04-17User2300......

 

 And I would like to determine which rows are showing the following combinations:

  • same city, same period, same user, same value
  • same city, same period, different user, same value
  • same city, different period, same user, same value

 

Is it possible to achieve this with DAX, or shall I use the PowerQuery editor only?

Thanks!

Fred

1 ACCEPTED SOLUTION

The Group By will look for a grouping of all 4 fields.  So it's like if CIty A, Period1, User A, Value 1 then count +1.

 

If the user is different, then that would be a different group. 

 

Here is my inital mock up dataset. 

 

ss1.PNG

 

I did the group by like this:

ss2.PNG

 

The result dataset is like this:

 

ss3.PNG

View solution in original post

4 REPLIES 4
joshcomputer1
Helper V
Helper V

Just looking at what you are requesting...I would suggest to use the query editor. It seems like you want to "group by" city, same period, same user, same value. To do this, go to edit queries. Click Group By. Advanced. Include the different groupings in the top section. The bottom section is probably just a count rows of those groupings (if you have a sum or other aggregate, try that instead of count rows). 

I appreciate your swift response!

But how can I identify cases such as "same city, different period, same user, same value"?

 

Say I have the following scenario:

 

city A, period 1, user B, value C

city A, period 1, user B, value C

city A, period 2, user B, value C

 

At the end, I would like to have this in my resulting table:

 

city A, period 1, user B, value C, count 2

city A, period 2, user B, value C, count 1

 

I understand I'd have to group by city, user and value, but how can I ensure I won't have cases with the same period appearing more than once?

Thanks.

 

The Group By will look for a grouping of all 4 fields.  So it's like if CIty A, Period1, User A, Value 1 then count +1.

 

If the user is different, then that would be a different group. 

 

Here is my inital mock up dataset. 

 

ss1.PNG

 

I did the group by like this:

ss2.PNG

 

The result dataset is like this:

 

ss3.PNG

Thank you!

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