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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Gustavo91Peru
New Member

How to know which value repeats the most in every product I have?

Hi guys,

 

I´m having issues with the following topic.

 

I have products that are related to different clients, and they have opinions about them.

 

Example: 

 
PRODUCTOCLIENTEOPINION
A1GOOD
A2GOOD
A3BAD
B4GREAT
B5GREAT
B6GOOD
C7LAME
CPERFECT
C9PERFECT
 

How can I extract which opinion @repeats the most in each product in a dashboard im doing??

 

Thanks in advance!

 
1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @Gustavo91Peru ,

 

My previous measure is wrong, it's calculating based on alphabetical values.

 

I tried a new one and handling ties:

 

Measure =
VAR _tbl = SELECTCOLUMNS(TOPN(1; SUMMARIZE('Table'; 'Table'[PRODUCTO]; 'Table'[OPINION]; "Count"; COUNT('Table'[OPINION])); [Count]; DESC); "Opinion"; 'Table'[OPINION])
RETURN IF(COUNTROWS(_tbl) > 1; CONCATENATEX(_tbl; [Opinion]; ";"); _tbl)
 
Capture.PNG
 
Ricardo


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

Proud to be a Super User!



View solution in original post

3 REPLIES 3
camargos88
Community Champion
Community Champion

Hi @Gustavo91Peru ,

 

My previous measure is wrong, it's calculating based on alphabetical values.

 

I tried a new one and handling ties:

 

Measure =
VAR _tbl = SELECTCOLUMNS(TOPN(1; SUMMARIZE('Table'; 'Table'[PRODUCTO]; 'Table'[OPINION]; "Count"; COUNT('Table'[OPINION])); [Count]; DESC); "Opinion"; 'Table'[OPINION])
RETURN IF(COUNTROWS(_tbl) > 1; CONCATENATEX(_tbl; [Opinion]; ";"); _tbl)
 
Capture.PNG
 
Ricardo


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

Proud to be a Super User!



Greg_Deckler
Super User
Super User

Good thing I created MODE: https://community.powerbi.com/t5/Quick-Measures-Gallery/Mode-Single-Column/m-p/359150#M101

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
camargos88
Community Champion
Community Champion

Hi @Gustavo91Peru 

 

You can use this code to create a measure:

Measure =
VAR _tbl = MAXX(SUMMARIZE('Table'; 'Table'[PRODUCTO]; 'Table'[OPINION]; "Count"; COUNT('Table'[OPINION])); 'Table'[OPINION])
RETURN _tbl
 
You can remove the total from table visual.
 
The measure above is wrong, this one is correct:
 
Measure =
VAR _tbl = SELECTCOLUMNS(TOPN(1; SUMMARIZE('Table'; 'Table'[PRODUCTO]; 'Table'[OPINION]; "Count"; COUNT('Table'[OPINION])); [Count]; DESC); "Opinion"; 'Table'[OPINION])
RETURN IF(COUNTROWS(_tbl) > 1; CONCATENATEX(_tbl; [Opinion]; ";"); _tbl)
 
 
Ricardo
 
 
 

 



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

Proud to be a Super User!



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.