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

Group and Transpose a Table

Hi Folks,

I'm really keen to figure out an efficient way to solve the following data transformation challenge.

 

I have a monthly report which provides Employment Status (NEW or EW) for a list of Employees structured like this:

image.png

 

1. My first requirement is to determine which employees have changed status from NEW to EW

2. My second requirement is to count how many months they've been "EW" for.

 

The table below shows the transformation required (req 1), with the last column containing the count of months, as per req 2 above

image.png

 

I can achieve this, but in a very convoluted way (e.g. searching and replacing NEW and EW with zeros and ones, then pivoting, then replacing back the values). There must be a better way! Any help much appreciated.

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@SimonJF,

Please check the following PBIX file.
https://1drv.ms/u/s!AhsotbnGu1Nok3NaWmXqRMpE6DBW

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@SimonJF,

Please check the following PBIX file.
https://1drv.ms/u/s!AhsotbnGu1Nok3NaWmXqRMpE6DBW

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

The file is not available any more

Lydia, that is fantastic - very efficient way of doing it. Really appreciate your help. Some great techniques in the .pbix you created. Superstar.

dilumd
Solution Supplier
Solution Supplier

Hi @SimonJF,

 

I have tired your case with group function in Power BI, just check whether you’re looking for something like this?

 

Power Bi Help.JPG

Thanks Dilumd for taking the time.

Unfortunately that doesn't get me the time series table with Month as columns and a unique row of employee name where they have converted from NEW to EW.

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.