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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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