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
FM
New Member

Dax to produce distinct count of comments (12 comment fields) per supplier across all raters

Hello PBI Community,

I have a supplier rating system that allows a rater to enter comments in 12 fields.  My aim is to have a distinct count of comments per supplier across all raters.  I have had difficulty with a dax expression that will provide this distinct count.  Note:  The comments fields are not mandatory, so the count will vary by each rater for each supplier.

Table below reduced to 3 columns for this example.

 
1 REPLY 1
edhans
Super User
Super User

There was nothing attached, but you should unpivot those fields in Power Query so there is one comment field and it will have a common supplier code rather than one supplier code with 12 fields.

 

  1. Load your data into Power Query - or it is already there.
  2. Right-click on the Supplier field and select "unpivot other columns"
  3. Rename the "Attribute" and "Value" columns as desired.

 

It will look like this, which DAX can easiliy handle as it is tabular.

 

20191219 13_52_00-Book1 - Excel.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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