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

Create Table from Query for a Matrix/Graph

Hi all, 

 

I have data in Power BI Desktop connected to a Dynamics app through the XrmToolBox tool "Power Query (M) Builder". This data has Results and Targets for various performance metrics by quarter and year. I would like to create a table that transposes the Results and Targets to columns. That way I can create a "percent to target" for each performance metric at each quarter. 

 

This is what my data currently looks like. I created a Unique ID concatening the performance metric and time:

Unique IDResultsTarget
Project investment:2019 Q2 225000
Project investment:2019 Q2215000 
Quality of Health Rating:2019 Q1 1
Quality of Health Rating:2019 Q11 

 

What I would like the data to show:

Unique IDResultsTarget
Project investment:2019 Q1215000225000
Quality of Health Rating:2019 Q111

 

I have experience making Power BI Dashboards and Tableau dashboards look very pretty. But this is my first time really having to alter the data. 

 

The "raw" data cannot be merged the way I would like these three columns to be. It contains other unique values that need to be separated for results and targets. Is there a way to create a new measure that does this? Or create an intermediary table?

 

Thank you all!

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi,

with your sample data you can use Power Query to get the desired result:

  1. Open Power Query Editor and select column Unique ID --> Unpivot other columns
  2. Select column Attribut --> Pivot Column (Value column is Value).

Done

 

Regards FrankAT

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

After testing, I think it is the best way to implement it in Power Query as FrankAT suggested. 

1.gif

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This was really helpful. Thank you!!!

FrankAT
Community Champion
Community Champion

Hi,

with your sample data you can use Power Query to get the desired result:

  1. Open Power Query Editor and select column Unique ID --> Unpivot other columns
  2. Select column Attribut --> Pivot Column (Value column is Value).

Done

 

Regards FrankAT

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.