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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
anaib
Frequent Visitor

Evaluate text field value and create a column based on unique occurrences

Hello everyone,

I have a huge data center usage dataset that contains a colum "EquipmentId".  The Equipment ID colulmn contains alpha numerical values.  In a million plus rows, there are a couple of hundred unique equipment Ids.  I need create a column that associates each unique equipment Id to IT department.  

I have it working by using IF statements but it's not a very elegant solution, IMO.  Looking for your help on how this can be done perhaps by inserting another table etc.?

 

Here is the sample dataset:

EquipmentIdCostDatacenterDate
123456abc100South1/3/2024
98765xyz104North1/4/2024
87234234kj201South2/1/2024
9876234bs300South2/5/2024
27342asdf100North2/8/2024
123456abc219.8South1/3/2024
98765xyz239.4South1/4/2024
87234234kj259North2/1/2024
9876234bs278.6South2/5/2024
27342asdf298.2South2/8/2024
123456abc317.8North1/3/2024
98765xyz337.4South1/4/2024
87234234kj357South2/1/2024
9876234bs376.6North2/5/2024
27342asdf396.2South2/8/2024
123456abc415.8South1/3/2024
98765xyz435.4North1/4/2024
87234234kj455South2/1/2024
9876234bs474.6South2/5/2024
27342asdf494.2North

2/8/2024

 

I have a separate table with all unique equipment Ids and it's correspondending department here:

EquipmentIdDepartment
123456abcHosting
98765xyzCommunication
87234234kjHelpDesk
9876234bsHosting
27342asdfHelpDesk

 

I need to create a slicer and filter for reporting on cost per department.  Your help is greatly appreciated.

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

Go to 'Transform Data'

jgeddes_0-1711548687039.png

Select the table with all of your data and then select 'Merge Queries'

jgeddes_1-1711548759273.png

Select the mapping table and then select the 'EquipmentId' column for both tables...
After clicking 'OK' you will have a new column added to your table that has a table in each row. 

Expand that column. Select only the Department and deselect the 'Use original column name...'

jgeddes_2-1711548933391.png

After clicking OK you should have the desired result in your table...

jgeddes_3-1711548973866.png

 





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

Proud to be a Super User!





View solution in original post

4 REPLIES 4
jgeddes
Super User
Super User

Go to 'Transform Data'

jgeddes_0-1711548687039.png

Select the table with all of your data and then select 'Merge Queries'

jgeddes_1-1711548759273.png

Select the mapping table and then select the 'EquipmentId' column for both tables...
After clicking 'OK' you will have a new column added to your table that has a table in each row. 

Expand that column. Select only the Department and deselect the 'Use original column name...'

jgeddes_2-1711548933391.png

After clicking OK you should have the desired result in your table...

jgeddes_3-1711548973866.png

 





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

Proud to be a Super User!





anaib
Frequent Visitor

Truly appreciate it @jgeddes .  Worked like a charm.

jgeddes
Super User
Super User

Have you considered merging the two tables together using the 'EquipmentId' column as the link and then expanding the resulting column to include only the 'Department"?





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

Proud to be a Super User!





anaib
Frequent Visitor

Hi @jgeddes 

Thank you for the pointer.  I will look up how to do that.  I am an infra guy 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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