__STYLES__
This project is designed to be a useful tool to help with providing 3 popular candies to give to visiting trick or treaters. The tool uses data from 85 different candies. The selection of the candies uses a weighted score which uses the win percent, the sugar percent and the price percent information.
The primary objective was to create a tool to select the top three candies based on user selection of flavours and types to give to trick or treaters. There is a supporting page which provides an analysis of the candies based on the user selection of flavours and types.
Methodology:
= Table.AddColumn(Source, "Weighted Score", each (0.60 * [winpercent]) + (0.20 * [sugarpercent]) + (0.20 * [pricepercent]))
= Table.AddRankColumn( #"Changed Type2", "Rank", { "Weighted Score", Order.Descending }, [ RankKind = RankKind.Competition ])
= Table.AddColumn(#"Expanded candy-image-urls", "Sugar Group", each if [Sugar Percent] <= 0.33 then "Low" else if [Sugar Percent] <= 0.66 then "Medium" else "High")
= Table.AddColumn(#"Added Sugar Group Column", "Price Group", each if [Price Percent] <= 0.33 then "Low" else if [Price Percent] <= 0.66 then "Medium" else "High")
= Table.AddColumn(#"Changed Type", "Sugar Group Sort Order", each if [Sugar Group] = "Low" then 1 else if [Sugar Group] = "Medium" then 2 else 3)
let
`Source = #"candy-data",`
`#"Added Conditional Column" = Table.AddColumn(Source, "Type Sort Order", each if [Type] = "Bar" then 1 else if [Type] = "Hard" then 2 else if [Type] = "Packaged" then 3 else 4),`
`#"Changed Type" = Table.TransformColumnTypes(#"Added Conditional Column",{{"Type Sort Order", Int64.Type}}),`
`#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Rank", "Image_URL"}),`
`#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Sugar Percent", "Price Percent", "Win Percent", "Sugar Group", "Price Group", "Sugar Group Sort Order", "Price Group Sort Order", "Type", "Weighted Score", "Type Sort Order", "Candy Name", "Chocolate", "Fruity", "Caramel", "Nuts", "Nougat", "Crisped Rice Wafer", "Hard", "Bar", "Packaged"}),`
`#"Removed Columns2" = Table.RemoveColumns(#"Reordered Columns",{"Hard", "Bar", "Packaged"}),`
`#"Reordered Columns1" = Table.ReorderColumns(#"Removed Columns2",{"Candy Name", "Sugar Percent", "Price Percent", "Win Percent", "Sugar Group", "Price Group", "Sugar Group Sort Order", "Price Group Sort Order", "Type", "Weighted Score", "Type Sort Order", "Chocolate", "Fruity", "Caramel", "Nuts", "Nougat", "Crisped Rice Wafer"}),`
`#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Reordered Columns1", {"Type Sort Order", "Weighted Score", "Type", "Price Group Sort Order", "Sugar Group Sort Order", "Price Group", "Sugar Group", "Win Percent", "Price Percent", "Sugar Percent", "Candy Name"}, "Attribute", "Value"),`
`#"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Flavour"}, {"Value", "Has Flavour"}})`
in
`#"Renamed Columns`
I then created small supporting tables for each flavour and type that contained two columns and two rows. An example using the Nuts table is shown here. These tables were made by manually entering the values for the first table and then duplicating the query and changing the column names using the Advanced Query Editor.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WikwtVtJRMlSK1YlW8ssHMg2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Contains Nuts" = _t, Nuts_Key = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Contains Nuts", type text}, {"Nuts_Key", Int64.Type}})
in
`#"Changed Type"`
I then unticked the enable load option for the Candy Image URLs table as this table was not needed in the data model.
I then clicked close and apply to load the queries into the Power BI desktop model.
Before continuing I created an empty table to store the report measures called _Measures.
I then created relationships between the supporting tables the candy_flavours table and the candy data table.
19. Two more pages were added to the report to hold a welcome page and pages with visuals. The canvas size was set at 1,960 pixels wide by 1,100 pixels high. These dimensions were chosen to keep close to a 16:9 ratio and allow for the large number of slicers.
Visuals and Measures were created as needed to build the report.
After all visuals were created and placed. I used Canva to create a design of the same dimensions as the Power BI report.
I loaded backgrounds obtained from Creative Fabrica to use as report backgrounds. I don't normally use graphical backgrounds in my reports. I tend to use solid colours or gradient colours. But for this report I chose backgrounds that suited the Halloween theme for the report.
Canva was then used to create the shaped backgrounds for the visuals and added to the backgrounds. I used screenshots of my Power BI report to assist with placing the shapes.
The backgrounds were then downloaded and added to Power BI.
The visuals were adjusted to match the shapes on the background.
Bookmarks were created for the two pages of visuals and configured to reflect the default page view with no slicers selected. This was to assist with the clear slicer buttons to be added to the report.
Page navigation and Clear Filters buttons were created and configured.
The pages were renamed to suitable names
I hid all pages except for the Home page, which is the initial page to be viewed, this is to create a clean navigation system for the users.