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
Anonymous
Not applicable

Help needed with transforming a column with two types of numeric values

Hello all!

 

Apologies if this has been covered before, but I could not find a suitable answer. I am transforming data in Power Query that relates to sick leave percentages and hours. In a query, I have a column that includes values for both. Is there a way to separate them quickly? A functionality that I have not thought of? There are five types of time events that include the aforementioned values: sickness hours, accident hours, theoretical hours, sick leave % and accident absence %. How to separate the numbers for sick leave % and accident absence % from the rest? 

 

Attached is a snapshot of the table so you get the idea. 

 

Cheers for your help and for this forum, 

Jani 

 

janiliukkonen_0-1638523679649.png

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

You could add a subcategory column with an if statement in Power Query, similar to 

if List.Contains({"sick leave", ...........},[event column....]) then "a" else "b")

then Pivot (from the Transform menu) the new subcategory column.

I've only given you some of the syntax for the column so you can complete it

 

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

I'm not quite sure what you want the result to be after "separation".

 

If you want it to look something like this, then go with @HotChilli's suggestion:

AlexisOlson_0-1638569232744.png

 

If not, then you'll need to specify what the desired result should be.

HotChilli
Super User
Super User

You could add a subcategory column with an if statement in Power Query, similar to 

if List.Contains({"sick leave", ...........},[event column....]) then "a" else "b")

then Pivot (from the Transform menu) the new subcategory column.

I've only given you some of the syntax for the column so you can complete it

 

Anonymous
Not applicable

Hello, 

 

Yes, thank you both for the help! I will go with @HotChilli s suggestion. 

 

All the best, 

Jani

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