Search

Search this blog:

Search This Blog

Tenth Day of Christmas: Comicgen Custom Visual


  ðŸŽµ On the tenth day of Christmas, my true love gave to me... 

Data driven emotions,

Meaningful Switches

Syncing Slicers Slicing,

Conditional Drill-through Button,

Verified User Selections

Dynamic titles,

Custom theme colors,

Appended queries,

Table expanded columns

and

a PDF in Power BI🎵

Custom Visual Review: Comicgen 

Scores

Data Clarity: 4/10

Versatility: 7/10

Fun Factor: 10/10

PBI Certified: No

Description

The Comicgen custom visual is a great way to bring emotion to your data. It uses cartoon drawings to display different emotions and poses based on data. 

I must admit, I would never have sought out this visual in a business scenario, but maybe it has a place. Humans are more likely to remember emotive material than neutral material (Hamann, 2001). Emotive material is something we can connect with, usually through remembered experiences. Words such as laughter, joyful and success are more memorable than the neutral words of month, sales, and invest. So, if you want people to connect with your data and remember your report, add more emotion to it. 

Sure, this leaves more open to interpretation, so you definitely want to back up this visual with some hard facts and figures, but maybe there's a reason emojis are so popular and perhaps there is a place for them in business reporting. I'd love to hear your thoughts. 

Overall, it's a fun visual and emotions are applicable to almost any dataset so it is fairly versatile (that is if we can learn to accept comics in our business reports). 

Formatting Options

Like most Power BI visuals, Comicgen has the following formatting options: 

  • General
  • Title
  • Background
  • Lock Aspect Ratio
  • Border
  • Shadow
  • Visual Header

There is nothing special in any of these options, just the typical settings that all visuals have. However, Comicgen has one additional formatting option called 'Comic Settings' that makes the visual work.

Comic Settings

This is where all the magic happens. Comic settings lets you adjust the character, pose and emotion of your visual. It's possible to pick a static pose and emotion, or tell the visual to update based on your data. 

Comic

At the time of writing this post, the Comicgen visual has 7 comic options available: Ava, Bean, Evan, Dee, Dey, Priya and Ringo. These must be preselected, and cannot update with a change in your data. 

Pose

The Comicgen visual has many poses to choose from: Ponting Right (pointingright), Ponting Up (pointingup), Yuhoo (yuhoo), Super Perfect (superperfect), Holding Laptop (holdinglaptop), Angry Frustrated (angryfrustrated), Hands Folded (handsfolded), Hands on Hip (handsonhip), Holding Book (holdingbook), Reading Paper (readingpaper), Thumbs Up (thumbsup), Thinking hmm (thinkinghmm). 


In addition to all those options above, there is an option for 'Data Driven' emotion. In order to use the 'Data Driven' option, you must have either a measure or column which returns exactly the value in (brackets) in the list above. Basically, you have to spell the poses exactly as they are written in the visual, but without the spaces. For some reason, they fixed the spelling mistake on 'pointing' for the data driven, but not in the format pane when you select it manually. ;-)

Emotion

The Comicgen visual currently has seven emotions: Normal, Laugh, Sad, Angry, Worried, Surprised, Wink. 


Emotions can also be 'Data Driven'. So far, all emotions are single words so you don't need to worry about removing spaces. Make sure you write the data exactly as in the list, and your visual will work.

Mirror

This is such a simple option, but so important. You may have been distraught to discover that Dey can only point right and not left, well don't worry, just change the Mirror setting from 'Regular' to 'Mirror' and he'll point left. 

Only Face

This is another handy option, and I used it to place my comic inside the donut hole of my donut chart. The default is 'False', which means you can see the body and poses of your comic, but you do have the option to set this to 'True'. Unfortunately, there's a lot of white empty space when this option is set to 'True', so the responsive sizing of this visual could use some improvement, but with some clever layering it can work. 

Report Example

Alright, so how do we put this Comicgen visual to use in our SantaList.pbix file? Most datasets will not contain perfect pose and emotion words created for this visual, so we'll use the DAX SWITCH function that we looked at yesterday to convert our data into something this visual can understand. Recall we wrote a measure for pose and a measure for emotion: 

Pose =
SWITCH (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ),
    "Nice""Yuhoo",
    "Naughty""AngryFrustrated",
    "HandsFolded"
)

Emotion =
SWITCH (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ),
    "Nice""Laugh",
    "Naughty""worried",
    "normal"
)

Today, we will use those two measures in our Comicgen visual. 

How To: 

  1. Open the SantaList.pbix file.
  2. In the Visualizations pane, click the three dots, then select Get more visuals
  3. Search for 'Comic' and add the Comicgen visual to your report.
  4. Select the 'Check the List' page of your report. It's still looking pretty empty.
  5. Add the Comicgen visual to this page.
  6. Put the [Emotion] measure in the Emotion Data box.
  7. Put the [Pose] measure in the Pose Data box. 
  8. Click the paint roller and expand the Comic Settings section. 
  9. Select any Comic you like.
  10. Select 'Data Driven' for Pose.
  11. Select 'Data Driven' for Emotion.
  12. Save and test your file. It should show a different pose if you select a name on the naughty list. 

It's starting to come together! Tune in again tomorrow for the next gift in the 12 Days of Christmas series where we'll look at another custom visual, the Enlighten Data Story, and see how this can help us compose Santa's letter. 

Ninth Day of Christmas: DAX function SWITCH


 ðŸŽµ On the ninth day of Christmas, my true love gave to me... 

Meaningful Switches, 

Syncing Slicers Slicing,

Conditional Drill-through Button,

Verified User Selections

Dynamic titles,

Custom theme colors,

Appended queries,

Table expanded columns

and

a PDF in Power BI🎵

Conditional Statements: DAX IF() Function

The IF function is really powerful, and since it's also an Excel function many of us already know how to use it. In fact, we've used it before in this 12 Days of Christmas series. Let's do a quick review of how the IF function works. It takes three arguments: 

  1. Logical test (required)
  2. Value if true (required)
  3. Value if false (optional)

We can see that IF allows us to ask a question (aka logical test) that has exactly two responses: True or False. This worked well when we were checking if the SantaList[Name] column was filtered to exactly one value. HASONEVALUE function returns only two choices - True or False and that works perfectly with the IF function. 

It can work in other cases where only two choices exist, for example Santa's List only has two options: 

  1. Naughty
  2. Nice

That means we can write a measure that returns a number based on the status of the name (we can use this for conditional formatting if it's a number): 

Icon IF =
IF (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ) = "Nice"
    1,
    0
)

Then we can apply conditional formatting to our visualizations. Like I've said before, conditional formatting has permeated many areas of Power BI, so you'll get good at it before too long. 

However, on second thought, we actually have three options: 

  1. Naughty
  2. Nice
  3. No selection

A single IF statement cannot handle three cases, but SWITCH can. (Yes, I know nested IF statements can too, but they're messy.)

Conditional DAX Function: SWITCH

The SWITCH function allows us to provide as many options (aka cases) as we want. The SWITCH function takes at least three arguments: 

  1. Expression (required)
  2. Value1 (required)
  3. Result1 (required)
  4. Value2 (optional)
  5. Result2 (optional)
  6. ValueN (optional)
  7. ResultN (optional)
  8. ResultElse (optional)

There are lots of Value and Result arguments floating around, so this can be a confusing function the first time you see it. Let's see what our Icon measure looks like with SWITCH:

Icon =
SWITCH (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ),
    "Nice"1,
    "Naughty"0,
    -1
)

Note I have used the Shift key and Enter key on the keyboard to put Result1 ("Nice") and Value1 (1) on their own line. This makes it easy to see that -1 is the ResultElse. If the selected value in the Naughty or Nice column is not Nice or Naughty, then this measure will return -1. If the ResultElse is left blank, then the measure will return BLANK(). 

Now that we know how SWITCH works, we can write a few functions to add more meaning to our report. 

How would you feel if you were on the naughty list?

Emotion =
SWITCH (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ),
    "Nice""Laugh",
    "Naughty""worried",
    "normal"
)

What would Santa say to someone on the Nice list?

Letter =
SWITCH (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ),
    "Nice""Looks like you have been nice in 2020. Keep up the good work!",
    "Naughty",
        "Looks like you have been naughty in 2020. Best change your ways before Christmas.",
    "Pick a name."
)

What pose would you make if you found out you were on the Nice list?

Pose =
SWITCH (
    SELECTEDVALUE ( 'Santa List'[Naughty or Nice?] ),
    "Nice""Yuhoo",
    "Naughty""AngryFrustrated",
    "HandsFolded"
)

How to:

  1. Open the SantaList.pbix file.
  2. Create new measures as above for:
    1. Icon
    2. Emotion
    3. Letter
    4. Pose
  3. Create a Card visual on the 'Check the List' page using the [Letter] measure.
  4. Select the table visual from the 'Summary' page.
  5. It should have SantaList[Name] column in values.
  6. Click the down arrow next to the [Name] column in the values > Conditional Formatting > Icons
  7. Use the [Icon] measure we created above to apply conditional formatting.
  8. Pick appropriate icons.
  9. Click OK.
  10. Save the report.
Cool! You've just becoming a coding guru. SWITCH functions are a handy tool to have in your toolkit, so keep practicing them. Tune in again tomorrow for the next gift in the 12 Days of Christmas series where we'll look at the Comicgen custom visual and see how those poses and emotions will come into play.

Eighth Day of Christmas: Sync Slicers


 ðŸŽµ On the eighth day of Christmas, my true love gave to me... 

Syncing Slicers Slicing,

Conditional Drill-through Button,

Verified User Selections

Dynamic titles,

Custom theme colors,

Appended queries,

Table expanded columns

and

a PDF in Power BI🎵

Filter Data

There are so many choices for filtering data in Power BI; how do you choose when to use each method? Here are a few of the main filter options: 

  • Filter data at data source
  • Filter data in Power Query
  • Filter using the Filter pane: 
    • Filters on all pages
    • Filters on this page
    • Filters on this visual
  • Filter data using Slicers
  • Bonus: Filter data in the data view (note this does not impact the report)

If you never need the data for anything, filtering at the data source is a great option. Typically this is not possible. Data is a hot commodity and surely it will be useful for something someday, right? Well, I'm surely not going to make the decision to axe it. 

That's the beauty of Power BI - it can handle large datasets, and has the ability to do filtering for you. The first thing you should do in every report when you Transform Data is Filter your data in Power Query. Choose only the columns you need and filter to select only the rows that are relevant for this report. For example, you may only need data from the last 3 years or data specific to a product of focus in order to analyze faults.

For BAU reporting, use the filter pane. Don't make a new report for every month or each region. Power BI makes it really easy to build in dynamic filtering capability. The filter pane has some fantastic functionality that has developed over the years. It is available to end users of the report which means they can interact with the filters and update the report to show the views and data they care about most. It allows for relative date filtering, report, page and visual level filtering, top N filtering and more. 

Finally, if you can't achieve what you need with any of the above filters, use slicers. Slicers provide visual cues to your end user, hierarchical filter functionality, relative date filtering, and the ability to sync slicers across multiple report pages. 



Sync Slicers

What does it mean to 'sync slicers' and how do we do it? If you've ever copied a slicer from one Power BI page to another, you will have seen this question: 

I did a frantic Google search the first time I saw this - what does it mean when visuals 'stay in sync'? Well, in the case of slicers, it means that when you select a value in the slicer on one page, all pages with that slicer synced will update to that value. This means you don't have to keep selecting the same month or region on every page - Power BI remembers what you last selected. Pretty handy. 

If you aren't great with keyboard shortcuts (often the only way to copy/paste in Power BI), the Sync Slicers pane is the best way to take advantage of the Sync Slicers functionality. Turn on the Sync Slicers pane by clicking the 'Sync Slicers' button in the View tab. 

In the image above, you'll notice that I'm on the Home page of the report, and I have selected the SantaList[Name] slicer. In the 'Sync Slicers' pane I have ticked the box to 'Sync' this slicer on the 'Check the List' page, but I have NOT ticked the box to make this slicer 'Visible' on the 'Check the List' page. 

This mimics that drill-through functionality we were looking for - whatever the user selects on the 'Home' page will be filtered/sliced on the 'Check the List' page. However, I don't want them to be able to make any changes from the 'Check the List' page, nor do I have space to display the SantaList[Name] slicer on the 'Check the List' page. So, by ticking only the box for 'Sync' and not 'Visible' I can filter the data on one page based on a selection made on another. 

Note: The 'Sync' box must be ticked on ALL pages where you want the slicer to apply, otherwise it will not work. In other words, if you have 'Sync' ticked on the Home page, and 'Visible' ticked on Home and Check the List pages, you'll see the slicer on both pages, but you will need to reselect the name for each page, and could even select a different name on each page. The slicers are not synced at all (the 'Sync' tickbox you have selected for the Home page does nothing without a friend).

How to:

  1. Open the SantaList.pbix file.
  2. Select the SantaList[Name] Slicer visual on the Home page.
  3. Turn on the Sync Slicers pane.
  4. Sync the Slicer to the Check the List page.
  5. Save and test your file.

I thought I'd keep it simple for the first day of the year. All the hard work was done last year with the DAX and buttons, now you can enjoy the fruits of your labor and test out a few different names. Are you on the naughty list? Tune in again tomorrow for the next gift in the 12 Days of Christmas series where we'll delve back into some DAX and learn about SWITCH (and why it can be tidier than IF).

Custom Visual Review: Charticulator

This is not your ordinary custom visual - this is EVERY custom visual. Charticulator puts the power to design and develop custom visuals to ...