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
jpt1228
Responsive Resident
Responsive Resident

KPI Data Structure with multiple data types

Hello, I am building a visuilization for our company KPI's. They are in units, dollars, and percentages depending on the KPI.

 

I have been working through various structures to get to the solution. I have tried one table with goals and actuals by month then transformed in data editor by unpivoting the month columns but since they are in dollars, units, and percentages figured out I can't do that because the value field has to be the same type for all the values.

 

Dollar KPI GoalJan-17Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17Oct-17Nov-17Dec-17
KPI1 Work Orders333333      
KPI2 Sales$9$12$3         
KPI3 % Completed5%10%15%20%25%30%35%40%75%85%90%100%
             
Dollar KPI ActualJan-17Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17Oct-17Nov-17Dec-17
KPI1 Orders321435      
KPI2 Sales$9$10$6         
KPI3 % Completed10%15%15%15%20%40%      

 

Then I tried to create a table for each KPI but that left me with a mess of fields. Ideally I would like to pull in the KPI list, Goal and Value into the visuilization and filter on just the KPI I want. Any suggestions?

 

Thanks

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @jpt1228,

 

Based on my test, you should be able to follow steps below to unpivot your tables to different columns for each KPI like below.

 

r1.PNG

 

1. Duplicate your original table in Query Editor.

 

d1.PNG

 

2. Filter the "Dollar KPI Goal" column on the duplicated table, and only keep rows for "KPI1 Work Orders".

 

f1.PNG

 

3. Unpivot the table, rename "Attribute" column to "Month Year", "Value" column to "Work Orders"

 

upivot`1.PNG

 

4. Repeat all three steps above for "KPI2 Sales" and "KPI3 % Completed".

 

5. Use 'Append Queries' option to append all the three unpivoted tables to a single table.

 

append.PNGappend2.PNG

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @jpt1228,

 

Based on my test, you should be able to follow steps below to unpivot your tables to different columns for each KPI like below.

 

r1.PNG

 

1. Duplicate your original table in Query Editor.

 

d1.PNG

 

2. Filter the "Dollar KPI Goal" column on the duplicated table, and only keep rows for "KPI1 Work Orders".

 

f1.PNG

 

3. Unpivot the table, rename "Attribute" column to "Month Year", "Value" column to "Work Orders"

 

upivot`1.PNG

 

4. Repeat all three steps above for "KPI2 Sales" and "KPI3 % Completed".

 

5. Use 'Append Queries' option to append all the three unpivoted tables to a single table.

 

append.PNGappend2.PNG

 

Regards

I was able to follow your instructions and add the goals below the actual and then sort and unpivot then append by measure tyoe... dollars, units, percentages.

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.