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
Kalachuchi
Helper III
Helper III

Visualization with Feedback

I have a table which has the following data.

FeedbackProviderNameWeekCustomerService.1 CustomerService.2 CustomerService.3OverAll
Jewell Maddox1SometimesSometimes RarelySometimes
Rolland Gerry3UsuallyUsuallyRarelyUsually
Kalyn Tara4Almost AlwaysUsuallyUsuallyUsually

 

for each rating there is a corresponding rate

FrequencyRate
Almost Always5
Usually4
Sometimes3
Rarely2

 

I need to have a column chart with y axis as my frequency and x axis is Week column getting the average overall column per week

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

Hi, @Kalachuchi 

According to your description, you want to get a column chart with the y-axis as my frequency, and the x-axis is the Week column with the average of value per week. I think you should do some transformation on your data in the Power query first, you can follow my steps:

  1. Select the three columns and Unpovit them:

v-robertq-msft_0-1613617107296.png

 

  1. Select the first table and merge like this:

v-robertq-msft_1-1613617107303.png

 

v-robertq-msft_2-1613617107309.png

 

This is the M query in the advanced editor, you can copy and paste into the advanced editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8kotT83JUfBNTEnJr1DSUTIE4uD83NSSzNzUYjR2UGJRak4limCsTrRSUH5OTmJeioJ7alERSNYYiEOLSxNzwGoRLLh2mBBIs3diTmWeQkhiUSJQwgSIHXNy84tLFBxzyhMri3GYBDcgFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [FeedbackProviderName = _t, Week = _t, CustomerService.1 = _t, #" CustomerService.2" = _t, #" CustomerService.3" = _t, OverAll = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"FeedbackProviderName", type text}, {"Week", Int64.Type}, {"CustomerService.1", type text}, {" CustomerService.2", type text}, {" CustomerService.3", type text}, {"OverAll", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"FeedbackProviderName", "Week", "OverAll"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Value", "Frequency"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"OverAll"})
in
#"Removed Columns"

And you can get a table like this:

v-robertq-msft_3-1613617107313.png

 

  1. Then create a column chart and place it like this:

v-robertq-msft_4-1613617107321.png

 

And you can get what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @Kalachuchi 

According to your description, you want to get a column chart with the y-axis as my frequency, and the x-axis is the Week column with the average of value per week. I think you should do some transformation on your data in the Power query first, you can follow my steps:

  1. Select the three columns and Unpovit them:

v-robertq-msft_0-1613617107296.png

 

  1. Select the first table and merge like this:

v-robertq-msft_1-1613617107303.png

 

v-robertq-msft_2-1613617107309.png

 

This is the M query in the advanced editor, you can copy and paste into the advanced editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8kotT83JUfBNTEnJr1DSUTIE4uD83NSSzNzUYjR2UGJRak4limCsTrRSUH5OTmJeioJ7alERSNYYiEOLSxNzwGoRLLh2mBBIs3diTmWeQkhiUSJQwgSIHXNy84tLFBxzyhMri3GYBDcgFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [FeedbackProviderName = _t, Week = _t, CustomerService.1 = _t, #" CustomerService.2" = _t, #" CustomerService.3" = _t, OverAll = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"FeedbackProviderName", type text}, {"Week", Int64.Type}, {"CustomerService.1", type text}, {" CustomerService.2", type text}, {" CustomerService.3", type text}, {"OverAll", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"FeedbackProviderName", "Week", "OverAll"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Value", "Frequency"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"OverAll"})
in
#"Removed Columns"

And you can get a table like this:

v-robertq-msft_3-1613617107313.png

 

  1. Then create a column chart and place it like this:

v-robertq-msft_4-1613617107321.png

 

And you can get what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

amitchandak
Super User
Super User

@Kalachuchi , Unpivot the first table

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

 

Join with the second table(rating) hope 1-M  join

 

create a new measure

averagex(Table, related(rating[Rate])

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.