From Boring to BRILLIANT: How CUSTOM LABELS in Power BI Will Make Your REPORTS Shine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
finally there we have measure driven data labels which let you set the values of your labels using measures to basically whatever you like to show on your labels which is super powerful and yes that was kind of possible before with some weird workarounds but now it is much more straightforward so let's see how we can create an example like this one and let's go over all of the things that you need to know about this new feature let's get started [Applause] welcome to how to power bi my name is boss and if this is the very first time for you visiting this channel 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 dive in straight away and explore this new feature which lets you set the values of your labels using measures now of course you need to be on the latest version of power bi which is at the moment of recording May 23 all right and then we can follow along now I have over here already charts set up and I want to add some normal labels to it so let's select it and let's go to the formatting options now here we have data labels let's turn them on and then we open up this data label section and here we see we have one series sales actual in my case and for the series we can set all of the options values and background now let's go to values let's go down a bit and there is the new feature custom label we can turn it on but nothing happens just yet because here we have the field then we can now add to the labels now for this we need a measure so let's get back here once we have written the measure so we have to write the measure first so let's do this let's go here to the databane and I'm going to add a new measure now let's go for something simple I want to show my actual sales so square bracket open I'm going to look for my sales measure there it is and I also want to show let's say the year over here sales growth okay now I'm going to refer to another magic that I have and that's it now let's see how that looks like on our labels so back here on the formatting options we go again to data labels and now here for the field click on add data and here in my metrics table there we have our labels measure let's select it and that doesn't look so good why not because it just shows the full value and all of the decimal places it combines that with that second measure there's no space in between whatsoever so let's go back to a measure and fix this now the way to fix it is with the format function now here we can just wrap both of our measures that we refer to inside of a format function so we can say format sales actual and then comma and the second argument is going to be a custom formatting string well for the second measure we can do exactly the same so let's put this also here inside of a format function and then here we have quotation mark quotation mark now here we need custom formatting strings between the quotation marks now if you have no clue about custom formatting strings no worries it's not that difficult but if you want to know all of the ins and outs just check out this video over here now how it works is as follows we have pound samples so hashtags for optional placeholders zeros for mandatory placeholders all right so if I have one zero well always one digit will show right now if I want to have also a comma for a thousand separator then we can do a bond symbol comma that bound sample bound symbol zero now this will always show a thousand separator and then we can do a decimal separator and then for example if I always want to have one decimal place well a zero for the first decimal all right now if we want to show values in thousands or Millions then we can put in a comma right in front of the decimal placeholder one comma chosen thousands two commands would show it in millions all right but let's first see how this will look like now here we have the first measure formatted not the second measure then we need to do the same but this one I want to show in percentages so 0.0 percentage all right let's see how this looks like now that looks better however still a bit weird because we have no separator between the results of the two measures so let's fix that quickly and that is relatively simple we can just add over here what we want in between in between quotation marks all right and let's say I want to have a pipeline symbol and combine that with the second measure okay that already looks much better now of course if there's not enough space it will not show as we have there for the last column and add the column here for September so we can play around with the formatting a little bit or make the chart bigger now let's do that quickly I'm going to go here to formatting data labels and then over here I'm going to choose the smallest font size maybe that fixes it now if not then what you can also still do is get rid of the background maybe you don't need it and we can go over here under properties two Advanced options and then turn responsiveness off now you see for me it still didn't fix the issue however I cannot either make the chart a bit bigger or I can make well the label is a bit smaller right so I can go back to a measure and then labels and maybe I don't want to have that decimal place there at the end for our sales so I'm going to get rid of that and maybe there is still a bit of space for showing okay that it's in thousands no let's have a look antenna we have our label showing perfect so that means we don't need that y-axis anymore so let's get rid of it quickly so I'm gonna go back to our formatting options and turn the y-axis off now that is already pretty nice but what would happen if we keep on adding more information to our labels now let's try this I'm gonna go to a measure and also put in the forecast value so over here I'm just going to copy that first part and then paste it below it and then here instead of sales actual I want to have forecast so over here we have the sales forecast perfect now let's see how that looks like now that starts to look kind of messy however if you really want to show that much information on your labels then maybe you want to break it down over multiple lines now how can we achieve that well first I thought if we go back to a measure and then here we can add a unicar done which is basically a line break okay and if you add this and maybe I also add it over here then let's see if it does what we hope it does and unfortunately it doesn't so that's not gonna work so that made me think how can we then achieve it well what we could do is maybe add sales actuals a second time so now we have two series and then one is going to show the data labels at the top and one is going to show the data labels below it now let's see if that approach works now I'm going to go back to our visualization and then here we can add sales actual a second time but then here for the line y-axis okay so I'm going to click here on add data and then here I'm going to choose my sales actual okay so two times the same series two remove the line or to hide it what you can do is just under formatting set the store graph to zero now for the formatting of the daily labels now you have to watch out because we have sales actual and sales actual two times now thinking over here that sales actual the second one is the one that we want to change labels off because now we have two times the same labels we can go over here and get rid of the custom labeling so I turn it off however it turns it off for both because it sees it as the same measure so maybe if we create kind of a dummy measure which we don't have the same value that works but let's try that I'm going to add a new measure and this measure is going to return exactly the same value as sales actual so let's call it sales actual dummy which is going to be equal to well sales actual now here we just have to update the measure that we have on the line y-axis because that one needs to be that dummy measure that we just created so over here I'm going to select sales actual dummy all right and then we can go to the formatting options not a legend we don't need just turn it off and then we can go to the data labels now at the moment it's still showing the same values for sales actual and sales actual dummy now here we have to be careful that we select sales actual dummy all right and then for the dummy let's say we want to show well the actual values right so then we can go a little bit more down and here we have custom label now custom label we can turn offer on now for dummy we need to have it off all right and then here for the other one sales actual there we want to have it on well it suddenly turned off so let's turn it on again and then make sure that the label show now it still looks a little bit messy why because we have the Unicorn done characters in there so let's clean up the labels measure okay I'm going to get rid of the Unicorn done all right just like this and let's say we only want to show sales forecast and the year over year percentage and now that looks pretty good we have the actual value there inside of the column and then the forecast value and the year over year percentage right above it now of course we can play around with formatting and maybe also swap it so that the main total value is at the top and the forecast value and the of the Year percentage maybe inside of the column but that is just same solution the other way around now if you wanted the other way around of course no problem just go back to data labels and then just be a little bit careful which one is selected and make sure that you know which one shows where so for sales actual there I can say I want to have the values inside and all right and then for the dummy there I want the position to be above the line okay you see at the moment only the actual sales shows so we have to double check here for sales actual dummy if we go down well that one is showing the actual sales and for the other one sales actual and we go down well there we should be showing the labels and still doesn't show well that's maybe because of the color so let's see if that makes a difference also not and maybe if we add a background also not now remember if a label doesn't fit inside of the columns well it cannot show so that means we have to make the chart a little bit wider all right and then at some point fits I will show that's one option you see now they're slowly popping up or second option is to well go over here to the columns and then here on the columns we can play around with the inner padding and if we make the inner padding less means there's more space and the labels cannot show you see now all the labels are showing but of course I could also have made the labels a little bit smaller and maybe it would also be nice to have the total actual label bold all right so let me quickly make these two changes I'm going to go over here to data labels again and here I would like to show for the actuals that shows above the columns I want to show it in bold all right and here we can make the chart a little bit smaller okay now you see it disappear again however if I now go back to our measure and I would just get rid of that one this show again and except for April so let me make it a bit bigger yes there you go we also have April there now I think this is already pretty amazing but the next thing that I want to build is Togo the toggle that lets the end user choose what they want to have on the labels for example actual versus forecast or the year of the Year growth percentage now I did that in this video over here but that was still with this weird workaround with Dynamic labels not so easy now let's see if we can use this new feature for it now I'm going to insert first of all it feels parameter because first I thought this is a typical case where you can use Fields parameters and then use that parameter on our new labels right now let's see how far we get now I'm going to go here to modeling and then new parameter and then Fields now here you can give it a nice name and choose the Matrix that you want to toggle between now you see here I have different measures and let's say we want to have first of all the absolute values right sales actual we also want to be able to see the maximum men and we want to be able to see the sales here over here growth percentage okay now let's say that's it now here I just leave the name as it is parameter that's fine for now and I'm going to add a slice on the report page for the slicer let's get rid of the header alright so here the formatting options slice ahead I'm going to turn off and then here for values there let's make it a little bit smaller let's go for let's say font size 10 all right then resize it I'm going to put it just below the title for now and then for the main chart what we don't need that line series anymore so let's get rid of that one okay and then we can go to the formatting options when we update the labels right so let's go over here to data labels and over here on the values there we have custom label and we want to have this for sales actual okay and instead of having here labels I want to choose the fields parameter so that it shows the selected field okay now add data parameter and there we have the field parameter click on it nothing happens because over here this is just one column in that Fields parameter table and you cannot select it all right so we still are looking at the sales actuals that's of course not great so how are we going to fix this now well we need a measure there on fields right so also here we need to write that measure then right so let's add a new measure and then here we can call this one label switch and here I want to switch so let's use the switch function and I want to check the value that the user selected in this license which we can do with the selected value function which only Returns value when one value is selected okay so we can look in the parameter table where we have a column with the well structured references to these fields okay and maybe in case somebody doesn't multi-select then we can go for sales actuals all right so that is going to be the default now then we can check the selected value and if it's equal to and over here we can return the measure name of the very first one which is going to be let's say actual sales and if it is then we want to well we turn the actual sales just like this and then we continue with the other ones and so we have still the max men so also there have a measure and if it is selected then we want to have Max Min and I continue with the last one so over here we have the year over year growth brand percentage and then we turn that measure well percentage salesy over here okay now that's close the switch function and then we can take our visual again go to the formatting options and then we are going to have a look here on the data labels now here we can click on add data and we can now go for our new measure now we call that label switch so label switch there it is okay so let's see if it works at the moment sales actual and selected and if I click here on Max men well nothing and then CLC over here something changed but still doesn't look great now let's fix this issue so let's go back to our label switch measure and here well what is missing the format function just like before now starting with the last one because that one is more straightforward one so format sales year over year percentage I want to have it in percentages so over here zero zero 0.0 percent okay now I also need a good data market at the end perfect okay now let's see how it looks like now now that is already better right so I can already toggle between sales actual and sales year over year percentage okay perfect and why is Max mid not working well over there you see I created a measure Max men and without going over all of the details well what it does is basically it summarizes the sales actual by year quad a month right and then looks for the maximum same for the minimum and then if the sales is equal to the maximum or sales is equal to the minimum then return well the actual sales now and what is missing is well what if it's not right so over here I want to have when it's not equal to the maximum Min I want to have quotation mark space with Dash mark now what is important is that there's a space in between so not just like this and also zero that would also not work so we need to have quotation mark space rotation Mark okay you see that works we have only the maximum the minimum showing but for the other ones well you still see the background because there is a space right so if you don't want that well then you probably best off to turn the background off right so in the formatting then go to data labels and then here on the values oh sorry in the background there you can turn it off all right that's it so now we have a nice little toggle that has a switch between sales actual Max Min and sales year over year percentage and of course using the measuring we can return whatever we like now that's it this is how you can work with measure driven data labels now if you have any questions or suggestions put them in the comment section below I want to thank you for watching if you want to see more videos like this check out these videos over here and see you in the next video
Info
Channel: How to Power BI
Views: 74,720
Rating: undefined out of 5
Keywords: power bi tutorial, power bi tutorial for beginners, how to power bi, data training, bas dohmen, measure driven data labels, power bi visualization, dashboard design, power bi dashboard, power bi dashboard design, power bi dax, dax, power bi, powerbi, actual vs forecast, creative dashboard in power bi, power bi data labels, custom labels, custom labels powerbi
Id: J56xoO5tWhk
Channel Id: undefined
Length: 18min 45sec (1125 seconds)
Published: Wed May 31 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.