Turn Any IMAGE into an INTERACTIVE VISUAL in Power BI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
you can turn any picture into an interactive visual which can be super helpful for example when you run a department store and you want to summarize your data onto a floor map and that floor map should be interactive with other visuals on your report page or maybe sell car components and you want to have an image of a car and by selecting a certain car component you see all of the data for that selected component now in this video I'm going to show you how to set it up without using custom visuals [Applause] welcome to how to power bi my name is boss and if this is the very first time for you visiting this channel then make sure to hit that subscribe button to stay up to date on all of my videos in which I share everything I know about power bi now let's have a look how you can turn any image into an interactive Visual and example that we're going to recreate is this one over here we have a floor map for a department store and here we are visualizing every Department in a different color we have menswear women's wear and getware and right next to it I created a line chart that shows the sales over time and just by selecting in one of the Departments for example menswear you see it filters the other visual now let's get started now as a starting point I only have that line chart and right next to it we're going to insert first of all an image an image of the floor map so I'm gonna go here to the top to insert and then we're going to go here to image now let's take the image and put it right now next to the line chart then resize it so that it has more or less the same height and then we go here to the right hand side to format style and there we have the scaling set to normal all right so the next thing that we need to do is create a shape map a shape map that visualizes the different departments as rectangles the shape map is still a preview option so we have to go first to file and then to options and settings and then options and then here on the preview features there just make sure that the shape map visual is selected and click on ok now after enabling it you will find it on the visualization so let's insert one now shape map is not meant for showing precise geographical locations however it is meant for comparing regions with each other by filling them up with different colors now if you go to formatting options and then map settings then here we can choose the map type and there are already a few that you can choose from and the most interesting one is all the way at the bottom because there we have the option to choose a custom map and this custom map needs to be in the format of a double Json file which lets you store geographical data however we are going to use it to store where the regions are on an image now let me show you how it's done now we need a tool to create these type of files and that lets us draw the regions that we need in the right places on the image now although there are many tools that let you do this the one that we are going to use is free and open source which is qgis geographical Information Systems okay now where can you download it just go to their website which is qgis.org and there on the first page you will find a download option all right now just download it and after downloading it and installing it you can open it up and it looks like this over here now the first thing that we need is our image because on top of image we want to create our shapes alright now to insert our image we can just go here to layer and then we can go here to add layer and we want to have what is called a rasterly now from here we can just browse to our image to our picture just select it press on open and click on ADD now here we have a first layer with our image now all of the layers you will see here in the bottom left corner and we can deselect it to highlight re-select it to show it all right now we want to create a second one and on the second layer we're going to create the shapes that we want to display on the image so let's go here to layer again and now we go for create layer and we want to have a shape file layer now let's give it a name so this is going to be my floor map then fine encoding we live as it is the geometry type we set to polygon guess we can leave as it is and here we can add more Fields now here the field that's always there is the ID field however in this case we could add another field for the Department not the department data type is going to be tax so string so that's good and then we can click here on add to Fields list and just like this we can add more fields to all of the shapes that we're going to create which are polygons okay now let's cling on okay and then here from the top we can go into editing mode so toggle editing on and then here we can choose to create the first polygon so let's click on this icon and now we can start drawing so I go here to the top left corner and it's probably a good idea to zoom in a little bit so zoom in Zoom that zoom in so that you can be a little bit more precise so in the stop left corner I'm going to add my first point then I go to the other corner so I want to go here to the top right click again and then I make the Four Corners that I want to have Okay so and after you created all four of them then the first polygon is done and then you right click and you see now we can type in the ID number so this is the first Department the department name is going to be Menswear that's like this and then just click here on okay and you see that is the first polygon and now I continue with the next one so I'm gonna go down a little bit and let's go for the women's wear so over here I do exactly the same so I click in all of the corners one two and then three four okay and then right click this is ID number two and department is then women's way now if you want to make adjustments then you can always go here to the selection tool and then here make your selection and then maybe zoom in a little bit holding the Ctrl key and scroll now you can zoom in and then let's say I want to adjust that point then you select the editing tools let me put this here to the left and then you can click on it once click on it twice and start moving it to wherever you like or alternatively you can also right click on that point then you see here all of the X Y coordinates and you can adjust it from here all right now let me quickly finish this now here I'm done with creating the shapes and you see we have three rectangles one rectangle for each department and if you want you can also play around with the formatting options so over here you can choose different colors now after we've done this well the hardest part is already done because now we can export it as a geojson file so to do that we can go here to the layer section right click and then export and then here save feature s and here the first thing that we need to choose is the format now the power bi shape map needs to open Json but dopa Json is not one of the options so we can go for geojson and then transform that into double Json which stores all geographical information a little bit more efficiently okay so let's go here for geojson and then later on transform it now then the file name this is going to be the floor map example and then here these three dots click on it and choose the location where you want to store it now give it a name so floor map now choose your location then we can click here on Save and everything else will leave as it is then just clicking on okay and now we successfully save this vector layer to whatever file pack you chose and now we have to transform it to a double Json so let's do this let's first open the browser and then go to a website that's called mapshaper.org now here we have to choose the file the geojson file that we just created and here we have the three rack Daniels that we drew in that other program now what's the next thing well now we can click here in the top right corner on export and here we can convert it to a topo Json click on export and then you can open it up in any text editor so if you would just open it then it would open a notepad and would look like there's over here but maybe you have a nicer text editor I for example use atom and then we can also and it easier way format it a little bit nicer okay so let me do that I'm going to open my tool so here I have the same file but open up in a different text editor why would you want to do that well here we have some color coding and there are easier ways to take what we have here and then put in a nicer format just with a click of a button and it looks like this okay and here we have the coordinates for the arcs if you were very precise in a previous program then you don't have to make changes here but maybe double check now in our case we have three rectangles and that means that that number that I have here the 1938 should be over here as well minus 138. now if you see something like this minus one three nine then you probably want to change that to 138 so that's the same okay now for me that looks pretty good I was precise enough before and then the next thing that you want to change is here to scale because if we leave the scale like it is then you will still not see anything once we use this for our shape map we need a much smaller scale so here we can take these numbers just copy it and then open Excel and here just paste it inside of a cell and then copy both of these values in a separate cell so one goes over here and then I take the other one put it in the cell right next to it all right and then we just divide one by the other so this one divided by that one that gives me the ratio between these two numbers and that is important now here for the first value I'm going to fill it something very small so zero zero zero zero one okay just a small number and then right next to it we need also very small number however the ratio needs to be the same as what it originally was so if we choose for the first one 0.0001 then for the second one we need to take the number divided by the ratio number okay and that is then the value that I can copy over now let's first adjust the formatting so over here is a number and let's let's add some decimals just like this okay and then let's copy that number over to our text file and then we place that second number there okay and then for the first number we can take over here to zero zero zero zero one let's copy that as well and put that here on the left hand side of the scale good now after adjusting the scale the third thing that we need to do is to go here to translate and then put the coordinates to zero zero all right which sometimes it now after that is done we can save our double Json file and use that for our shape map visual in power bi so let's save it and here we are back in power bi and we're going to select the shape map again go to formatting options visual matte settings now here we already selected the custom map and here now we can select our own custom map that we just created with the three rectangles all right so click on browse then select the double Json file not the geojson all right and there you go we have our three regions showing up in our shape map visual now let's make some changes first of all let's switch to the data section where we can put on location the Departments right because we have one rectangle for each department department so the location is basically the department so department on location now you see we have some of sales amounts still on color saturation now let's maybe remove that for now I see we have two blue rectangles and one gray one is one way now here you see when I hover over it I made a typo if all one of the fields it says women wear not women's wear okay now if you see something like this that me means you have to go back to your Doper Json file let me go back and then here we have all of the different properties and just adjust women wear to women's wear okay and that's it so that it's the same as in your data set so that there is a match okay and if I then save it and then go back to formatting for that map visual then we just have to re-import that map so again custom map browse and then you select the file again and that fixes the issue now the next thing that we can do is choose different columns for each department so that is formatting so fill colors colors and then here show all and then here we can choose what we want to see so gets where can be blue and then menswear can be orange and then women's wear can be yeah all right so you see now we have different colors now let's take the shape map and then drag it over here onto the image now first of all we want to get rid of the title so let's go hit the general title turn it off and then we also want to get rid of the background color so let's go into effects and then turn the background off and now we just have to position it exactly over the image and you see it's already pretty good you want to be a little bit more exact just go into properties position and then play around here with the coordinates and how big it is so here in the size however this or it looks pretty good now let me just make a few adjustments perfect okay and now let's see if it works now if I click here on one of the rectangles for example for menswear you see it's filtering the other visuals in my report on the selected department and same if I click on the other ones perfect so that is working now of course it would be nice if the colors would match and so that we have the same color for each department here is here and then we still see a little bit of the background image okay so we have to add a little bit of transparency however if we look here in the formatting options build colors there's no transparency option however we can create a measure that applies the color and transparency using conditional formatting but for that we need to write and measure so let's do this let's add a new measure and we can call this one color Department conditional formatting now first of all we need to know which department we're looking at so we can create a variable and then let's call this one department and we can use the selected value function which returns a value only when there's one volume okay so here that will mean we can look at the department ID column and only when there's one Department ID it returns well the department ID all right so then a second variable now this one is going to be for the transparency that we want to apply so let's say we want to have a transparency of 0.3 and then we can return the color so here probably easiest to go for a switch function all right and then here we can say Department and then we have if Department one then we want to have extracted color and then we can continue like this with the second department so over here apartment two then we want to have green Department three then we want to have orange okay now then we can close the switch function and return the color now instead of blue green and orange we're going to use RGB a chords now I just have to copy them over so let me copy over the first one and paste it over here now you see we have the RGB code for the color but we then also have the transparency that we choose to apply here and that we start in the variable transparency okay and to combine it we just use the ampersands all right so now we can do the same thing for the other one so let me copy that over and here we just have the matching colors that I also used in the rest of the report and we have the transparency okay now once this is done then we return the car and that we're going to use for conditional formatting so let's go back to the formatting options for the shape map then fill color colors and then here we're going to choose conditional format and the formatting style that we are going to use is field value and then here we can choose the color Department conditional formatting all right let's click on OK and that looks much better so you see we have transparency applied so that we can still see the background image and we can now click over here on menswear you see it also nicely matches with the other visualization so this looks perfect okay so here we have our interactive shape map based on our floor map image perfect now if you like we can still make further adjustments for example the board online around the shapes maybe we don't want it so let's go back here to fill colors border and you can also set the Border width to zero maybe it looks just a little bit cleaner all right and maybe you don't want to have different colors for each department but you want to have a gradient applied based on the sales for each department it's also possible we just need to play around then with the measure that we wrote for a conditional formatting so over here I applied a gradient color not the prettiest however at the idea is that you would write a measure like this one now imagine that apply as the gradient could look like this when you first figure out the department then the maximum total sales for all of the Departments same for the minimum and then you apply a transparency based on the scaling that you come up with right so you could look at the total sales amount for a certain Department see how far it is from the minimum apply a certain adjustment factor and divide that by the range and also here you can adjust that range a bit okay and then the end is the same basically as before okay now once you have that also you can use it on conditional formatting to apply a certain color with a gradient based on whatever value field you come up with now if you want to dive a bit deeper into that Dax calculation that I just showed just check out this video over here now that's it is how you can take any picture and turn it into an interactive visual using the native shape map Visual and power bi now of course there are many more use cases for this and you can create awesome designs now if you want to see more design videos then check out these videos over here if you have any questions just put them in the comment section below I want to thank you for watching and see you in the next video
Info
Channel: How to Power BI
Views: 86,237
Rating: undefined out of 5
Keywords: powerbi, howtopowerbi, shape map in power bi, shape map power bi custom, shape map visual power bi, QGIS, floormap powerbi, custom image powerbi, powerbi visualisation, powerbi design, datatraining, data training, bas dohmen
Id: kAMhh776V8w
Channel Id: undefined
Length: 19min 7sec (1147 seconds)
Published: Sun Nov 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.