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
anaib
Regular 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!





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!





Hi @jgeddes 

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

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.

Top Solution Authors
Top Kudoed Authors