4: Developing reports and visualizations using the Power BI Desktop
4.8 Create a card and KPI visualization
4: Developing reports and visualizations using the Power BI Desktop
4.8 Create a card and KPI visualization - Video Tutorials & Practice Problems
Video duration:
9m
Play a video:
<v Instructor>In this sublesson,</v> we're gonna create a card visualization, we'll format a card visualization, we're gonna create a KPI visualization, then we'll go ahead and format that KPI visualization. So let's go ahead and get our supporting git file hub open and go ahead and wait for the Power BI Desktop to open. Okay, so the first thing we're gonna do here is, we're gonna create a card visualization. And what we wanna do at this card visualization is we wanna use it to display a target for our total sales. And we're also gonna then use that target for our total sales to help support the KPI card which we're going to build next. So what I'm gonna do here is I'm actually just gonna create a brand new measure. I'm gonna go into New measure on the sales table, and I'm gonna go in and call this target sales. And I'm gonna hard-code its value to 35 million. Like so. Okay, so what I've done there is I've just created a measure and hard-coded it. I'm actually gonna go through and make it currency, and set it to English United States. So go ahead and format the measure as well. And what we're gonna use this measure for in a few moments here is to display in the card to show us what our yearly target sales can be. And then later on, when we build the KPI card, we're gonna be able to compare our different years to the target to see are we ahead or behind on that particular target. So let's go ahead. First thing we're gonna do is we're gonna build our card visualization so I'm just going to go into the visualizations here and zoom in. And the card visualization is this one right here. Says one, two, three. If I see the tool tip on there, it says Card so let's go ahead and click that. Zoom myself back out. We're gonna see that we have a blank visual here. Now this time I'm going to leave the visual alone. So I wanna go through and do the formatting at first, and then we'll put it where it actually belongs on the canvas. So what we're gonna do here is quite simply take our target sales and drop it into the fields bucket here 'cause we're just gonna split $35 million as our target. Okay, so we're just gonna go through and do a few formatting things. We're gonna click on the Format, and we'll go down here and we're gonna turn the Category label off. So I'm just gonna open this up a bit more so we can see these cards easier. We're gonna go ahead and turn the Category label off so we'll see the label was turned off underneath the actual amount there. We're going to go to our Background card as well, we're gonna turn it off. There we go, so now it's transparent. And what we're going to do next is we're gonna turn the Title card on. So we're actually gonna go ahead and give this a title. And what I wanna tell this is, total or target sales, let's go with this. Like so. All right, so now we've got our title there, let's go ahead and put it in the middle. Make sure that our text size is 14 for that. And we'll go find our data label card so close the title card up here, let's go to the data label here. And what I wanna do is turn this text size to 30. So instead of 45, I'm gonna call this 30 like so. So we have our amount looking like that. All right, so we pretty much have it formatted the way we want. Now let's go ahead and position it into the box. I'm just gonna make this visual a little smaller here so it sits something like that. And then we'll drag it into this position right here. So we can see what our target sales is. So at $35 million. So that is quite simply the card visualization. Nothing really much going on there, just wanna show you have the ability to do it, and set ourselves up for the KPI visualization here momentarily. Okay, so let's go ahead and build that KPI visualization. Once again what I'm gonna do here is, I'm just going to zoom in on the Visualizations pin like so. And the KPI is two over from the Card, it's the one that has this arrow up and arrow down, or should I say the triangle up and triangle down? And go ahead and click on that. We're gonna get a blank visual for a KPI being set up here. I'm once again gonna leave this alone until I'm finished formatting it. And what I'm gonna do here first is I'm gonna start putting some data into this, which is our normal practice from building visualizations, is to bind the data in first, and then do our formatting. So let's go ahead and drag in our total sales as the indicator. So that's what we wanna put on here as indicator. What we wanna do here on our trend axis is we're going to go down to the order date table and find our order date year. Let's go ahead and put that on the trend axis. Okay, seeing a little bit more here now. And then let's go ahead and close these two tables up here. All right, or I'll close that one table, I should say. And now let's go ahead and drag our target sales into the target goals. Okay, so we can see now that we have a goal of $35 million and that we are 156% over that in aggregate across our entire data set. So we're gonna go through and do a little bit more formatting on this, but let's go ahead and get this into the actual spot where we wanna put this first. So I'm just gonna roughly go like this. Like so. And let's go ahead and put that like that. Perfect, we have it exact where we want it here now. Already. So what we're gonna do here next is go and format the title here. So we'll go ahead and open our Format up here. Actually, we'll notice here that the KPI card does not have the focus here. So I'm just gonna go ahead and give it focus so that our format changes here. Let's go down and take care of our title first and we're just going to call this total sales target. Her total sales versus target sales, let's just go ahead and do that. All right, go ahead and hit Enter. And let's once again go ahead and move that to the center. We're happy with our text size and the font color, so that looks really good. All right, so let's go ahead and close this card up. The next thing that we're gonna want to do here is we're going to go into the Indicator card, we're gonna make the display units millions. So let's go ahead and do that, which was already set up, but we wanna force it to be millions. Then let's go in and do some further formatting here. By changing our text size to 30. So let's go ahead and drop that down to 30 so that looks a little bit smaller. All right, so that's becoming a little bit more digestible there. We can see in here we've got the title, the comparison to our target, we've got a goal here, which indicates the goal, which is right next to us over here in target sales. So let's go ahead and actually turn the Goal card off. So what I'm gonna do here is close the Indicator card up, go down to Goals, and I'm gonna turn the goal off because I have the goal right next to it here with this $35 million. So we can leave this piece here, so we can see that we are 156% over our goal in aggregate. Which is good. And then let's go ahead and turn our Background card off, like so. All right, then maybe we just need to do a little bit more positioning here so let's just move that over a smidge so that we can see that gray bar between the two different cards here. All right, looking good. Now the last thing we wanna do here is, we can see this as a little bit off balance here, so we've got our titles here, and this one comes down a little bit. Or our values, I should say. What I'm gonna do here is I'm actually just going to move this up a little bit so I can get the target sales amount to line up a little bit better with that right here. Just visually that finds this looks a little bit more appealing than if we had left it alone. And we can see here now that we've got what is called the Trend axis, so this little line that goes down and then back up. So if we want to turn that off, we could go over into, with the keypad visualization highlighted of course, we could go into the Formats. We could turn the trend axis off if we want, we notice that disappear. I like to leave that on, I think that looks quite nice. So we leave our trend axis on. And the one we have down below here is inside a goals as well, I actually left the distance on. So I can actually turn that off, and that would remove that percentage as well. So if we wanted to get rid of the percentage on how far over the goal we are, we could. But once again, I'm just gonna go ahead and leave that on the visual. All right, so two pretty simple visualizations there, the KPI and the card. So let's just wench in the measure here. So the target sales measure, we went and created that as a hard-coded value. In a production environment, I wouldn't do that. I would expect that targets would come in through some source system. 'Cause right now we're just giving a blanket target of $35 million, but most organizations like this would plan from target sales for a given year, or maybe target sales for a given year and product, or maybe target sales by given year, product, and sales territory. So every organization is a little different in terms of the granularity of their planning, but the salient point here is the fact that we would get that from a source and not actually have it hard-coded, and then allow those values to be compared against the KPI. But we want to keep this nice and simple, build a target in here so that we can actually drive this KPI visualization and make sure that we're able to drive the point home between these two visualizations here. All right, so that brings us to the end of this sublesson.