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
Paudek148
Frequent Visitor

Return value for 'text' in multiple columns

Hi, 

 

I have multiple columns with a number of values (in text format) and I want to find the total amount of each value from each columns. See example table below.

 

These are my data : 

Paudek148_0-1679936973090.png

 

This is the result I want to find : 

Paudek148_1-1679937016989.png

 

I tried this formula : 

Tot mattress= IF(FIND("mattress", 'table'[waste 1 ], 1, 0)<>0,1,0
and it works but only for one column. 
 

Which formula should I use to look each waste in each column?

ex : find the number of time 'mattress' is mentionned in column 'waste 1', 'waste 2' and 'waste 3'.

 

Thank you 🙂  

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Paudek148 .

In contrast to Excel's engine, which "thinks" cells".
The power bi tool "thinks columns".

As a result, before you start building metrics
In POWER QUERY, the table must be unpivoted .
Please see an attached picture:

Ritaf1983_0-1679968426797.png

you'll get unpivoted table like on picture below:

Ritaf1983_1-1679968504703.png

load it to your model

Ritaf1983_3-1679968624356.png

now you can drag and drop it to the table with counting

Ritaf1983_4-1679968786178.png

Link to sample file 
If my answer was helpful please give me a Kudos and accept as a Solution.

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Paudek148 .

In contrast to Excel's engine, which "thinks" cells".
The power bi tool "thinks columns".

As a result, before you start building metrics
In POWER QUERY, the table must be unpivoted .
Please see an attached picture:

Ritaf1983_0-1679968426797.png

you'll get unpivoted table like on picture below:

Ritaf1983_1-1679968504703.png

load it to your model

Ritaf1983_3-1679968624356.png

now you can drag and drop it to the table with counting

Ritaf1983_4-1679968786178.png

Link to sample file 
If my answer was helpful please give me a Kudos and accept as a Solution.

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.