Create a custom KPI Card in a Power BI report

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
yo what's up this is Patrick from guy in the cube and in this video I'm gonna show you how to create your own custom KPI car in park I stay tuned okay [Music] KPI cart what there's a native one there's lots of custom visuals why wouldn't I use that well you may look at the native visual you may look at the custom KPI visuals and go I just want a little more flexibility and then you think about writing your own custom visual but go out write any code and that's okay that's okay that's okay right or you just need like I said before your own flexibility to control the way it looks the way it feels how what's the target or what's the goal right and so in this video I'm going to show you how to create it so you guys know how I like to do instead of all this talking let's head over to my laptop okay so the first thing you want to do is you want to have two values that you want to compare so I'm gonna compare the current sales amount for the current year to the sales amount for last year and I'm using very simple Dax to do this I know when you look at look through this and I'm gonna make this PPI X file available and Adam will put a link to it down in the comments below and so I'm using some really simple Dax you can improve this and add more or I don't need a lot of comments about the Dax alright so I just want to compare whether or not the current sales that for this year by a particular employee is trending towards it has you know exceeded sales from last year and that's all I'm doing okay so the first thing you want to do when you create your cart is let's just show the total sales amount for the current year so I'm looking at 2015 for Hudson Oslo and I'm gonna create use a traditional car right the the cart that's in power bi I'm gonna format it a little bit I'm going to turn off the label I'm gonna change the display units to none and then I'm gonna decrease the size down to about 18 all right just give it a little format and then the next thing I want to do is I want to have a little indicator like a little stoplight green if the value is greater than last year and red if the value is less than last year to do that you need to write just a tiny bit of Dax okay so I created two measures two explicit measures one measure for if it's green so you can see right here I just say if the total sales amount is greater than the total sales amount from the same period last year sure one right and then I created one for the red and I said if the total sales amount it's less than the sales of the sales amount from last year one otherwise show zero and you'll see how I use the one in the zero when I said it this up then once you have those measures created you simply add a pie chart to your design canvas yes a pie chart the best use of a pie chart and then you take both of those and you drag them into the values section for that pie chart so KP are green and KPI red just like that okay and then I like to turn off everything I go to format I turn off the labels the title just turn off everything and then I go to my data colors and I'm gonna say for green make it green and for red make it red okay and you're probably wondering why well remember when I created these measures I said if the value is greater than short one and so in this case for 2014 for Hudson I was low my value is greater than but if I choose something else the value will be red and so if I choose I said in say in 2014 2015 if I choose 2014 you'll see Hudson's number the pie chart turns red and that's just because what I did with the Dax okay until now I'm gonna make this just a little tiny bit smaller little tiny bit smaller alright then the next thing you want to do is that I want to do what my card is I want to show like a monthly trim and so I want to see what the sales are for each month for the given year for the selected year but I want the bar to be red if they're lower than the same period last year so that month for last year and I want it to be green if it is you know exceeded that value for last year and so what I did what you can do is I created a measure that uses the switch statement so it's always true cuz I want to return a value and then I say if the sales amount is less than same period last year you know here's a hex call up for red and then if it's greater than here's a hex color for green and then if it's if it doesn't fall into any one of those buckets just make it yellow cuz I'm not quite sure maybe it's equal to okay and so what I'll do is I use a bar chart here and then a bar chart and we did month and then we take the sales amount there we go and then turn off everything go to format and let's turn off the x-axis this the title will turn off everything and then what you want to do is go to data colors and choose advanced control and then right at the top where it says format by choose fill value click on the the box right now it says first month and choose where sales or whatever the measure is that color KPI that I created them the measure that I showed you before select that click OK and now you'll see right the bars where it's less than last year it's red so I put this table here just to visualize it a little bit you can see the current January for 2014 is 504 and last year is 557 if you look through it all you can see it all right so now I have all the elements to build that card out so what I did was I added a little I just went to home and I inserted a shape which is just a square and I put a border around it a black border and now all I'm gonna do now it's gonna shrink this down a little bit as small as I can get it to fit in that box it's really simple now alright and it's actually just a lot of little visuals that I'm overlaying in this box right so I'm gonna drop this here so now I'm gonna take my little pie chart and drag it over here BAM and just like that I have my own little custom KPI car now if I choose Hudson hunt Hollandsworth or Jack Potter you can see how everything changes based on that person I have my own little KPI car I can choose 2015 I can choose 2016 you can see it just dynamically updates this is crazy Patrick how did you come up with this I don't know I just you know play with Barbie eyes and a lot of presentation and just a lot of cool stuff alright so how are you doing this now have you ever tried this before let me know you got any questions comments post them in the comments below your first time visiting the guy in the cube Channel you know what to do hit that subscribe button if you liked my video big thumbs up as always from Adam and myself thanks for watching we'll see you in the next video
Info
Channel: Guy in a Cube
Views: 136,310
Rating: 4.9780536 out of 5
Keywords: power bi dashboard, power bi desktop, power bi desktop tutorial, power bi desktop tutorial for beginners, power bi for beginners, power bi kpi, power bi kpi card, power bi kpi visual, power bi report design, power bi reports, power bi reports tutorial, power bi training, power bi tutorial, power bi tutorial for beginners, power bi visualization, power bi visualization tutorial, bi, data visualization, data visualization tutorial, power bi, powerbi
Id: zHzSBNES6jE
Channel Id: undefined
Length: 6min 45sec (405 seconds)
Published: Wed Apr 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.