Illuminate KPI cards with new shadow feature and conditional formatting

The May 2020 Power BI update (which was released today, May 19th, 2020) has a new feature that allows you to set a shadow around your visuals. I had a little bit of fun testing out this feature; I used it to to illuminate KPI cards with conditional formatting to tell a more interesting story.

To illustrate this new feature, I just created a simple Sales vs Sales Target KPI card, as you can see above.

I created a what-if parameter to set the Sales Target value and then calculated % Sales against this Target value. I then created another simple measure to set the shadow colour based on % Sales Target achieved. I used conditional formatting to change the shadow according to the following parameters:

  • If the % Sales vs Target is more than 90%, then Green,
  • If the % Sales vs Target is more than 70% but less than 90%, then Yellow,
  • otherwise Red.

Add following measures (I called it Shadow Color) for conditional formatting and this measure we will use to illuminate KPI card

Sales Status =
VAR __targetAchieved = [% Target Achieved] --simple measure to calculate % of target achieved dividing sales by target
RETURN
SWITCH (
    TRUE(),
    __targetAchieved > .9, 1,  --above 90%
    __targetAchieved > .7, 2, -- above 70%
    3
)
    
Shadow Color =
VAR __salesStatus = [Sales Status]
RETURN
SWITCH (
    __salesStatus,
    1, "#7FC600",
    2, "#F9C700",
    "#C6001C"
)
    

Let’s add above measure to set the shadow for the KPI Card. Follow steps in next image for conditional formatting:

  1. Click fx button to set conditional formatting
  2. Select Field Value in Format by drop down
  3. Under Based on field choose the measure name, in this case it is called Shadow Color
Conditional Formatting

Finally, make tweak to shadow settings by selecting Custom value in Preset section so that shadow show up around KPI card

Custom Preset Settings for Shadow

And that’s it! You can highlight visuals using this new shadow feature, along with conditional formatting, to create stunning reports. For an example of what the finished product looks like, please see the image at the beginning of this post.

I hope you find this new feature useful and are able to use it to tell a data story within your organization.

Useful Links

Read more about conditional formatting here.
Read more about the new shadow feature here.