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

Reformatting of table to suit data (unpivot?)

Hi all,

 

I have a table which I use to collect data from our teams on areas of improvements.  I currently produce a number of excels to suit the graphs I produce however I know theres a better way.  I unpivoted the data and Im nearly there but not quite in terms of format.  

 

The data is currently formatted as below:

 

Project NameGUIDStageDateProduct ScoreProduct CommentsService Score Service CommentsDefects Score Defects Comments
Project 1123Stage 11/1/219text8text7text
Project 2124Precon1/2/2110text7text5text
Project 3125Stage 11/3/215text6text9text

 

I would like to create a radar graph which shows all the different areas of improvement and sepertly report on their comments.  

 

To do this I presume I need to show the report as:

 

Project NameGUIDStageDateArea of Improvement ScoreComments
Project 1123Stage 11/1/21Product9text
Project 1123Stage 11/1/21Service8text
Project 1123Stage 11/1/21Defects7text
Project 2124Precon1/2/21Product10text
Project 2124Precon1/2/21Service7text
Project 2124Precon1/2/21Defects5text

 

Without having to create numerous rows for each project, how can I produce this within PowerBI?

 

As always, any help is greatly appreciated 🙂  

 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @eilidh3 ,

Try like following :

base data:

v-luwang-msft_0-1622451752967.png

Unpivot three column:

v-luwang-msft_1-1622452108323.png

Then get the below:

v-luwang-msft_2-1622452274726.png

Then apply and use the following dax to create a new table:

Table2 =
VAR test1 =
    SELECTCOLUMNS (
        'Table',
        "Project Name", 'Table'[Project Name],
        "GUID", 'Table'[GUID],
        "Stage", 'Table'[Stage],
        "Date", 'Table'[Date],
        "Area of Improvement", 'Table'[Attribute],
        "Score", 'Table'[Value],
        "Comments", "text"
    )
VAR test2 =
    SELECTCOLUMNS (
        'Table',
        "Project Name", 'Table'[Project Name],
        "GUID", 'Table'[GUID],
        "Stage", 'Table'[Stage],
        "Date", 'Table'[Date],
        "Area of Improvement", 'Table'[Attribute.1],
        "Score", 'Table'[Value.1],
        "Comments", "text"
    )
VAR test3 =
    SELECTCOLUMNS (
        'Table',
        "Project Name", 'Table'[Project Name],
        "GUID", 'Table'[GUID],
        "Stage", 'Table'[Stage],
        "Date", 'Table'[Date],
        "Area of Improvement", 'Table'[Attribute.2],
        "Score", 'Table'[Value.2],
        "Comments", "text"
    )
RETURN
    UNION ( test1, test2, test3 )

Final you will get the below:

v-luwang-msft_3-1622454455780.png

 

Wish it is helpful for you!

You could download my pbix file if you need!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @eilidh3 ,

Try like following :

base data:

v-luwang-msft_0-1622451752967.png

Unpivot three column:

v-luwang-msft_1-1622452108323.png

Then get the below:

v-luwang-msft_2-1622452274726.png

Then apply and use the following dax to create a new table:

Table2 =
VAR test1 =
    SELECTCOLUMNS (
        'Table',
        "Project Name", 'Table'[Project Name],
        "GUID", 'Table'[GUID],
        "Stage", 'Table'[Stage],
        "Date", 'Table'[Date],
        "Area of Improvement", 'Table'[Attribute],
        "Score", 'Table'[Value],
        "Comments", "text"
    )
VAR test2 =
    SELECTCOLUMNS (
        'Table',
        "Project Name", 'Table'[Project Name],
        "GUID", 'Table'[GUID],
        "Stage", 'Table'[Stage],
        "Date", 'Table'[Date],
        "Area of Improvement", 'Table'[Attribute.1],
        "Score", 'Table'[Value.1],
        "Comments", "text"
    )
VAR test3 =
    SELECTCOLUMNS (
        'Table',
        "Project Name", 'Table'[Project Name],
        "GUID", 'Table'[GUID],
        "Stage", 'Table'[Stage],
        "Date", 'Table'[Date],
        "Area of Improvement", 'Table'[Attribute.2],
        "Score", 'Table'[Value.2],
        "Comments", "text"
    )
RETURN
    UNION ( test1, test2, test3 )

Final you will get the below:

v-luwang-msft_3-1622454455780.png

 

Wish it is helpful for you!

You could download my pbix file if you need!

 

Best Regards

Lucien

amitchandak
Super User
Super User

@eilidh3 , One option I can see that you can unpivot data in power Query and then use it , If you can use that

 

https://radacad.com/pivot-and-unpivot-with-power-bi

 

In matrix you have option to show measure on row. But not not suitable for other visuals

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.