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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eric142
Frequent Visitor

Calculating number of times a word appears in multiple columns.

Hi,

 

I have 10 different columns in my table that will have 8 differnt posible words. I want the total count of how many times each word appears in each column. I am currenlty doing this with 10 mesures then adding them all together.  Then rebeat for all words and all calumns that will be 90 measures. Is there a way to do it in one messure for each word?

 
Trouble1 Picker = CALCULATE(COUNTAX('Calibration_Issues','Calibration_Issues'[1 Trouble]),'Calibration_Issues'[1 Trouble]= "Picker")
 
Thanks for any advice
Eric
 
 
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, you should select all columns other than those which have the 10 text entries, right click and select "Unpivot Other Columns".  To your visual, drag the Attribute field and write this measure

=countrows('Calibration_Issues')

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
eric142
Frequent Visitor

Thank you both for your replies, Ashish solution worked.  I will also record your solution MFelix as I see it as being usefull at a later time.

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, you should select all columns other than those which have the 10 text entries, right click and select "Unpivot Other Columns".  To your visual, drag the Attribute field and write this measure

=countrows('Calibration_Issues')

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MFelix
Super User
Super User

Hi @eric142 ,

 

Have you tried doing a disconnected table with the 10 words you need and then making a change to your formula to be similar to this one:

Trouble1 Picker = CALCULATE(COUNTAX('Calibration_Issues','Calibration_Issues'[1 Trouble]),'Calibration_Issues'[1 Trouble] in values (Table[Words]))

 

Then you would only have 10 measures and with a slicer or similar you could filter out the values you need.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.