Home Power BI
Category:

Power BI

If you are a consultant like me, you know how hard it can be to access Power BI Admin API or Service Principal. Sometimes, you need to see all the workspaces you have permission for and what’s inside them. Well, I found with MS Fabric, we can use notebooks and achieve it with a few steps:
  1. Get Tennant ID
  2. Connect to Tennant for POWER BI
  3. Call POWER BI REST API, get data and save data in Lake House
  4. Report using Power BI

If you are new to Microsoft Fabric and Notebooks, checkout this series on MS Docs – How to use notebooks – Microsoft Fabric | Microsoft Learn.

Get Tennant ID

There might be simple ways to get Tennant ID using Python, but the below code works to get Tennant ID of the current Notebook. 

import re
conf_list = spark.sparkContext.getConf().getAll()

# filter the configuration parameters to get the driver log URL
filtered_list = filter(lambda x: x[0] == 'spark.tracking.driverLogUrl', conf_list)
value=next(filtered_list,None)
url = value[1]

parts = url.split('/')
index=parts.index('sparkui') 
TennantID=parts[index+1]
print(TennantID)

Connect to Tennant for Power BI

First, I need an access token, so I use the authority URL to authenticate with my login. This gives me the workspaces I can access, but you can also use Azure APP and Service Principal authentication.

# Import the necessary libraries
# ! pip install adal
from adal import AuthenticationContext
import requests# Set the required parameters
TENANT_ID = TennantID
CLIENT_ID ='1aea3f97-edc6-4453-a59b-b88b0b803711'# this is Power BI Client Integrations client ID
RESOURCE = 'https://analysis.windows.net/powerbi/api'# Set the authority URL and create an authentication context
authority_url = f'https://login.microsoftonline.com/{TENANT_ID}'
context = AuthenticationContext(authority_url)# Acquire a user code and device code to authenticate the user
code_response = context.acquire_user_code(RESOURCE, CLIENT_ID)
print(code_response['message'])token_response = context.acquire_token_with_device_code(RESOURCE, code_response, CLIENT_ID)
access_token = token_response['accessToken']

The code above uses the Power BI Client Integration Client ID to connect to the service. It prompts me to enter a code to authenticate myself when I run it. This is fine for occasional or manual scripts but not very convenient otherwise.

Another option is to create an app and a service principal in Azure. This lets you authenticate and authorise your app to access Azure resources. To learn how to do this, check out this link –Power BI REST APIs for embedded analytics and automation – Power BI REST API | Microsoft Learn

!pip install azure.identity
from azure.identity import ClientSecretCredential
import json, requests, pandas as pdtenant_id= TennnatID
client_id = 'Your ClientID' client_secret='Your Client Secret' # Good to not hardcode client secret here, try to see how you can keep in Azure Key Valult safely
ResourceURL= 'https://analysis.windows.net/powerbi/api' APIURL='https://analysis.windows.net/powerbi/api/.default'
auth = ClientSecretCredential(authority = 'https://login.microsoftonline.com/',tenant_id = tenant_id,client_id = client_id,client_secret = client_secret)
access_token = auth.get_token(APIURL) access_token = access_token.token# print(access_token)

Following Call Power BI REST APIs and save them in Lakehouse

In this example, I’m only fetching the workspace ID, the dataset ID and the report ID, but you can use any other endpoint you can access. Just make sure you have the proper permissions and authentication tokens. The code is in Python, but you can use any language that supports HTTP requests.

# Set the base URL and headers for the API call
Baseurl = 'https://api.powerbi.com/v1.0/'#myorg/groups'
headers = {'Authorization': f'Bearer {access_token}'}
# print(headers)# Get a list of all workspaces in the organization
response = requests.get(Baseurl+'myorg/groups', headers=headers)if response.status_code == 200:
workspaces = response.json()['value']
# get list of all workspaces and their IDs and keep in a dataframe
import pandas as pd
for workspace in workspaces:
# print(workspace['name'], workspace['id'])
workspaces_df = pd.DataFrame(workspaces)
workspaces_df.head()
display(workspaces_df)
else:
print(f"Error: {response.status_code} - {response.text}")#create a dataframe to hold the list of all workspaces
workspaces_df = pd.DataFrame(workspaces)
workspaces_df.head()workspaces_df = workspaces_df.fillna('')
# replace spaces in columns with _
workspaces_df.columns = workspaces_df.columns.str.replace(' ', '_')
workspaces_df.head()#Create a spark dataframe from the Datasets_df
workspaces_spark_df = spark.createDataFrame(workspaces_df)
spark.sql("DROP TABLE IF EXISTS Workspaces")
workspaces_spark_df.write.format("delta").mode("overwrite").saveAsTable("Workspaces")

Datasets=[]
# Get a list of all datasets in the organization
for workspace in workspaces:
    # print(workspace['name'], workspace['id'])
    response = requests.get(Baseurl+f"myorg/groups/{workspace['id']}/datasets", headers=headers)
    if response.status_code == 200:
        datasets = response.json()['value']
        # get list of all datasets and their IDs and keep in a dataframe
        for dataset in datasets:
            # print(dataset['name'], dataset['id'])
            Datasets.append(dataset)
            #add workspace name and ID to the dataset
            dataset['Workspace Name'] = workspace['name']
            dataset['Workspace ID'] = workspace['id']


    else:
        print(f"Error: {response.status_code} - {response.text}")
# display(Datasets)


# Create a dataframe from the Datasets list
Datasets_df = pd.DataFrame(Datasets)
# select key columns
Datasets_df = Datasets_df[['name', 'id', 'Workspace Name', 'Workspace ID','configuredBy','webUrl','createdDate']]
# rename name and id to Dataset Name and Dataset ID
Datasets_df = Datasets_df.rename(columns={'name':'Dataset Name', 'id':'Dataset ID'})
# replace the null values with empty string
Datasets_df = Datasets_df.fillna('')
# replace spaces in columns with _  
Datasets_df.columns = Datasets_df.columns.str.replace(' ', '_')
Datasets_df.head()


#Create a spark dataframe from the Datasets_df
datasets_spark_df = spark.createDataFrame(Datasets_df)
spark.sql("DROP TABLE IF EXISTS Datasets")
datasets_spark_df.write.format("delta").mode("overwrite").saveAsTable("Datasets")
Reports=[]
# Get a list of all reports in the organization
for workspace in workspaces:
# print(workspace['name'], workspace['id'])
response = requests.get(Baseurl+f"myorg/groups/{workspace['id']}/reports", headers=headers)
if response.status_code == 200:
reports = response.json()['value']
# get list of all reports and their IDs and keep in a dataframe
for report in reports:
# print(report['name'], report['id'])
Reports.append(report)
#add workspace name and ID to the report
report['Workspace Name'] = workspace['name']
report['Workspace ID'] = workspace['id']


else:
print(f"Error: {response.status_code} - {response.text}")
# display(Reports)


# Create a dataframe from the Reports list
Reports_df = pd.DataFrame(Reports)
# select key columns
Reports_df = Reports_df[['name', 'id', 'Workspace Name', 'Workspace ID','webUrl','datasetId','datasetWorkspaceId']]
# rename name and id to Report Name and Report ID
Reports_df = Reports_df.rename(columns={'name':'Report Name', 'id':'Report ID'})
# replace the null values with empty string
Reports_df = Reports_df.fillna('')
# replace spaces in columns with _
Reports_df.columns = Reports_df.columns.str.replace(' ', '_')
# Reports_df.head()


#Create a spark dataframe from the Reports_df
reports_spark_df = spark.createDataFrame(Reports_df)
spark.sql("DROP TABLE IF EXISTS Reports")
reports_spark_df.write.format("delta").mode("overwrite").saveAsTable("Reports")
 
 In the code snippet above, I started by defining the Base URL to add the REST API URLs to it later. Then, I used the response status to handle any possible API issues. After that, I stored the response in the panda’s data frame and converted it to a spark data frame before saving it in the Lakehouse as a delta table. I also removed spaces from the column names because Spark tables don’t allow them. This is the same pattern that I followed for all the other APIs. 
 

Create Report

When I create a Lakehouse in Microsoft Fabric, it will automatically create some default options.

When I click on the ellipsis of two default options, Dataset(Default) or SQL endpoint, there are various ways to analyse data.

Now, you might be overwhelmed with all these different visualisation options available. Each one does serve a different purpose if you know the difference between them. But for my use case, I want a simple list of all workspaces, reports, who created them, configured them, etc. So,

I selected the Dataset(Default) option and clicked Create Paginated Report.

I dragged and dropped the columns I wanted to see in the table, such as workspace name, report name, owner, created date, etc.

That’s it! I now have a simple and handy list of all my workspaces in Microsoft Fabric. I could export, share or distribute this report to further audiences.


This is a simple use case, but it has much potential. Instead of using the default dataset, I could have created some relationships. I could have even used TOM to create a Dataset, relationships, measures, etc. I didn’t have enough time to explore that. Additionally, I wasn’t sure how to do it in Python. Maybe someone can try it and let me know how it goes. 

I was curious; I started everything with embedded API and how it could read data from different sources in Power BI. I wanted to document Workspaces, Datasets and Reports with all the details with Embedded API. But, I encountered a problem: “Embedding a DirectLake dataset is not supported with V1 embed token“. Maybe this will change, and then we can do amazing things. We could document various artifacts in a workspace, create reports and publish them in Power BI App—an intelligent way to document. For now, I used REST operations.

Another option is to use the Admin API and scanner API, start a trace and get the dataset metadata, document measures, etc. I just wanted to show these notebooks open doors to many amazing things. 🙂

Until next time,

Prathy 🙂

0 comment
0 FacebookTwitterPinterestEmail
USING TREE MAP AS LEGEND ON A PAGE in Power BI

I recently worked on two projects where the client wanted to show multiple metrics sliced by the same categorical data. For example, seeing how various metrics are performing over different regions or different product groups. A use case like this can be achieved in many ways; probably the best approach is to use small multiples functionality or to keep it simple, five same visuals with different metrics.

Let’s look into it with energy consumption data. Here, I want to show metrics 1 to 5 on different income levels over the years.

Five different visuals

When you know exactly how many categories you have in the requirement and how you want to display your data, then going for a certain number of visuals is my favourite approach.

UntitledImage

Using Small multiples

When there is no clarity about the number of categories, the small multiples feature is significant. For this use case, I went for two columns. Due to five categories, I get an extra blank space. It doesn’t look that bad, but I would like more control over the placement of visuals on the canvas. 

SmallMUltiples

When I compare Five individual visuals to small multiples, small multiples may have better performance from the number of queries point of view, and it also looks a bit tidier with one legend, one axis.

To have the best of both, we can use TreeMap visual as a legend

Tree Map visual as a legend

For the tree map, I used the income level column as a category and distinct count of the same column as value. I have turned off data labels, header icons and tool tips. I ensured I used the same “Max Axis” value for all visuals, making the comparison seamless. 

This approach is cleaner than showing the same legend for each visual and serves the same purpose as the usual legend: a user can identify what is what based on colour or shape and interact by clicking on the legend. 
https://prathy.com/wp-content/uploads/2022/06/2022-06-25_14-49-20-1-3.gif

The benefits of this approach are that your report stands out, a nice big legend is easy to interact with on touch screen devices and looks sleek rather than repeating the same legend. I hope the blog inspires someone out there.

Until next time,

Prathy 🙂

0 comment
3 FacebookTwitterPinterestEmail

The inspiration behind this post solely came from WHO website https://www.who.int/. I went onto to check some COVID data and found quick links on the main page quite interesting, hence this post. Using Buttons in Power BI is straight forward, and we see many Power BI report designers using it more often. What I observed, not everyone uses the amazing extra functionalities of Power BI Buttons. In this post, I want to use properties of Buttons, Shapes and try to achieve the look and feel I saw on the WHO website. The look I am going for is below:

 

Let’s see how we can create it in Power BI:

  1. Create a button, follow this article to create a button in Power BI Desktop – https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-buttons
  2. Add Text to Button. For the sake of the blog post, I am just going for Button 1, Button 2, etc.
  3. Add line shape and put it behind the Button, Send it back!
  4. Add Fill to All buttons same as the background colour of the page and no transparency.
  5. Select all buttons, change the fill transparency to 100 % on hover. Now your buttons will look something like below.
  6. Now change the text of each Button on Hover with a prefix of Empty Characters. Yes, empty characters!

https://emptycharacter.com/ is your friend when it comes to empty characters. From here copy an empty character and paste infant of your text in the Button. In this example, I pasted Empty Characters before Button Text on Hover. I went for three empty characters before each Button Text. That’s it, and you will have a subtle animated effect on your buttons.

I am sure someone out there must be thinking, why don’t we add a space before the text, I am sorry but that doesn’t work. Don’t know why! I am sure, Power BI doing something cleaver to not to show empty spaces before the text. Hope someone finds this post inspiring.
PBIX – https://1drv.ms/u/s!Avm7gbgZtlMlyhlTp2zkQxArZsOG?e=Fcd1Lm

Until next time,

Prathy 🙂

6 comments
6 FacebookTwitterPinterestEmail

Power BI Bookmarks, the secret behind many sleek reports, It revolutionised the entire PBI Report design approach. Initially, Bookmarks were portrayed more as some saved views, which can be used for storytelling than for navigation. However, we certainly saw more report designers using Bookmarks for navigation than for storytelling. In March 2020, we have a new functionality called Page navigation,  which brings us to the dilemma of which one to use and when?

#PowerBI Bookmarks vs Page Navigation

Power BI Page Navigation is an action type. Even though many have been using bookmarks for page navigation previously, the new Page Navigation action makes it a lot easier.

Power BI Bookmarks:

With bookmarks in Power BI Desktop, you capture the currently configured view of a report page, including filtering and the state of visuals. Later, you can go back to that state by selecting the saved Bookmark. – https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks

One of the essential factor to remember when creating a Bookmark is “Saved Elements”. As per Microsoft Docs, below elements are saved with Bookmark:

  • The current page
  • Filters
  • Slicers, including slicer type (for example, dropdown or list) and slicer state
  • Visual selection state (such as cross-highlight filters)
  • Sort order
  • Drill location
  • Visibility of an object (by using the Selection pane)
  • The focus or Spotlight modes of any visible object

We can use bookmarks for storytelling by using the View option of Bookmarks. Shapes, Images and Buttons action property can be used to navigate between bookmarks.

When it comes to moving between pages, both functionalities does the job perfectly, but one gives better usability than others. Our scenarios help us to choose the functionalities, and both have their pros and cons.

1. Strictly to move between pages:

We don’t see this use case when you are distributing Power BI Report Model using Power BI APPS in the Power BI Service; in all other distribution methods, when users want to have a navigation pane, with an action to go to a page; in this use case, Page Navigation functionality is the best choice.

PROS
  • Fewer Bookmarks to create and maintain
  • Clean Bookmarks window
CONS

They are limited to buttons only. If users want to use images/shapes, then they need to overlay image/shape with a blank button, then add Page Navigation action.

2. Many Visuals and many selections

I work with this use case more often than I want to. When working with many visuals on a single page and hiding some is so fiddly. When I design, I prefer to use different pages. I used to create a page for each action, followed by a bookmark for each page, hide all pages not needed.  This approach reduces potential human errors, also helps to troubleshoot. So for this approach, again, Page navigation works better.

PROS
  • Less hassle with selections
  • No need to worry about updating Bookmarks
  • Easy to troubleshoot
CONS
  • More Report pages, sometimes duplication of Report pages and content in them
  • Performance of visuals
  • Doesn’t work well with all Report Layouts

3. Different Report Layouts

When you are working with fancy layouts, like a scrollable page, tabbed navigation, pop up windows, etc., Page navigation just doesn’t work.  Even though it’s fiddly, Bookmarks give a seamless user experience.

For example, in below example, when I use page navigation functionality between report pages, every time I land on the page, it takes me back to the top of the page. But using Bookmarks, leave me at the same position on the page.

PROS
  • Seamless interaction with different report layouts
  • No need to load all visuals again
CONS
  • Need to update Bookmarks, every single time there is change
  • Copy and paste doesn’t work great
  • Working with many bookmarks gets fiddly
Using Page Navigation Action

Using Bookmarks

Summary

These are just a few scenarios. Both functionalities give the same user experience. End-user doesn’t know if you are using Bookmark or Page Navigation Action. As much as I love using bookmarks, grouping, selections in Power BI, I also struggle with many questions:

  1. Page navigation is limited to Button only,  if you are anyway using an image or shape, overlaying that with a blank button to navigate to a page. Is it worth to use Page Navigation or just create a bookmark?
  2. When you use many visuals on a single page, is it worth trying to figure out in which Bookmark you hid some shape or worth to create separate pages?
  3. When a visual take some time to load, is it reasonable to duplicate those over separate pages and use Page Navigation action or is it right to use bookmarks? So you don’t have to load time-consuming visuals again when switching between report pages?
  4. Is it worth fiddle to update Bookmark each time you make a change to your report layout or good to have separate pages?
  5. Use Bookmarks grouping or several pages, which one is easier when you have far too many actions to do
  6. Hiding visual does not run a query, which helps performance. So should I just use Bookmarks?

Strictly what is essential to you defines, which way to go. Page Navigation is impressive when I am working with small datasets. It helps a lot with designing and troubleshooting but yeah bookmarks gives a seamless user experience.

Till next time,

Prathy 🙂

3 comments
1 FacebookTwitterPinterestEmail

What is Progressive Disclosure?

Progressive disclosure is an interaction design pattern that sequences information and actions across several screens (e.g., a step-by-step signup flow). The purpose is to lower the chances that users will feel overwhelmed by what they encounter. By disclosing information progressively, interaction designers reveal only the essentials, and help users manage the complexity of feature-rich websites or applications.

https://www.interaction-design.org/literature/topics/progressive-disclosure

When we hear UX terms like Progressive Disclosure, it feels like they are essential for Web design or App design. Well, they are vital for report and dashboard design, especially landing pages. In this post, let’s look at the Horizontal card pattern.

Using Horizontal Cards:

2020 04 29 16 58 15 1

In the above example, I used a pattern to show details using action from the Card. When a user clicks on a card, the report will show details related to Card. It sounds straightforward, but it involves a lot of work using Power BI Functionalities: Buttons, Bookmarks, Sections, Grouping and Page Size.

There are few aesthetics I paid attention in this Report Page which are key for any landing page. Usually, a Landing page helps users to navigate around the Power BI Model, so it is important to highlight those navigation steps. In the above model, I used Buttons, labels and Images for navigation hints.

Button:

I again used the Button Hover effect as I used in the previous post. Instead of using images, I used a very subtle hover over shadow kind of effect. To achieve this, I added an Outline to the Button with the following properties.

UntitledImage

Under Button, I added a shape with below properties.

UntitledImage

My shape size is slightly less than the button size. So when the user looks at it, Shape looks like a card; overplayed Button gives an action to show detail and also hover over effect to provide User Experience users.

Labels:

I added a text label with an image to hint users to click on cards.

UntitledImage

Images:

I added images to navigate back to the landing page. Also, to help users to highlight which detail window belongs to which category.

UntitledImage

Bars:

I also added lines under buttons to show which tab has been selected using shapes in Power BI.

UntitledImage

That’s all; I hope this inspires you to create some Power BI Awesomeness.

You can view Power BI report here – Link

Prathy 😊

8 comments
2 FacebookTwitterPinterestEmail

This is a blog post series to show various ways of creating parts of landing pages for better UX and navigation

Tiles using, Images, Power BI buttons, hover effects and all the above

Either it is Power BI report or some web page, tiles are one of the best-known ways to add the user experience to landing pages. When Tiles has images, dynamic content, actions, they get more practical plus engaging. Let’s look at some ways of creating tiles in Power BI

Approach 1

This is probably the most common approach. Import an image to Power BI Desktop, add an action to go to the bookmark, in this case, a detail page and add some text under the image. This text can be dynamic with DAX.

UntitledImage

Approach 2

We can extend the example by adding a button when the user hovers over the button, a text appears giving the context of the action or detail.

2020 04 22 22 44 27 1

This can be achieved by putting an empty button on top of the image. Then update the properties of button to show text only “On Hover”

Approach 3

In the above example text is static, but we can make it dynamic.

2020 04 22 22 53 29 1

This can be done by using the expression functionality of Button Text property of the button. That gives the functionality to show dynamic text.

Approach 4

Having images are likeable but too many are never right, that’s when instead of going for an image, we can just show Button with Text. But on hover over we can add more context, like below:

Here, I am just using a group of visuals and an image to show details. I added static text with a URL feel.

Approach 5

Another way is to show static or dynamic text in the button, but instead of showing over the image, actually show under the image as a description.

To achieve this result, we use same text properties as shown in the above approaches but instead of using top or middle vertical alignment, go for bottom vertical alignment. Also, make the blank button size bigger than the image size so the text shows right under the image on hover over.

More landing pages tips to follow, hoping these examples leaves you with some inspiration.

You can download the PBIX here and view here

Prathy 🙂

0 comment
3 FacebookTwitterPinterestEmail

A quick post, how many times in Power BI Desktop, have you clicked on “No, remove the files.” and then say OOPS! Well, I did plenty of times to discover this trick.

In short, you can find those removed files under Temp folder like many other windows application files. Usually, the location will be somewhere like this – C:UsersprathyAppDataLocalMicrosoftPowerBI DesktopTempSaves. This location depends upon which version of Power BI Desktop you have. Beware, these files will be removed whenever you clear your Temp Directory.

In long let’s see what happens with Power BI Desktop Auto Recovery and where we can find PBI related files. By default Power BI Desktop saves Auto recovery files; you can find Auto Recovery settings under Power BI Desktop options.

When a user creates or opens a Power BI Model, Power BI desktop saves a copy under Auto Recovery and Temp Saves. When the user closes without saving, Power BI Desktop will save an Auto Recovered Power BI file under the Auto Recovery file location given under Power BI Options. When you click on “No, remove files”, It will remove files from the Auto Recovery folder. But, files under Temp Saves are still there.

Remember, every time you open a recovered file or open a file from Temp Saves, Power BI Desktop will refresh all queries again. I think it’s for security purpose, not great when your queries take a long time to reload all the data but it’s better than losing all the hard work.

That’s all, Temp Saves; saved my life many times. Hope it helps someone out there too.

Stay Safe!

Prathy

 

 

5 comments
8 FacebookTwitterPinterestEmail

This is a long overdue post, probably one of the most received questions on my blog was, How I designed a visual in one of my Power BI reports I published under my portfolio.  As I promised to many, let’s see how I did it. Sorry to spoil, but it is nothing but a layered Donut Chart, but how I approached to show values probably is a good one. Be aware; I created this report quite a long time ago, If I do it now, I probably would have taken a different approach or different visuals.

Here is the visual I am talking about:

NewImage

You can view the full report here – https://prathy.com/portfolio/school-uk/

The tricky bit of any good data visualisation is finding interesting data, inspiration and story. In my report, my story was to show the comparison of Ofsted school ratings among the total number of schools. I also wanted to carry my story between report pages with colours.

So in this particular visual, I wanted to make it visually appealing, so I decided to show two metrics on each donut visual, the measure I want and the total number of schools. Then I resized each visual in a way so that they look like one visual. Those days there were no grouping, but now we can group them as one visual too. Also, when I first designed this report, default Power BI donut chart didn’t have an option to resize the ring, so I went for Circular gauge by MAQ software. Now we can use the default Donut chart too.

However, due to the default responsive nature of Donut chart, we need to choose different inner radius value.

Next Labels:

As I decided to not show any labels of the rings for visual appeal, I added labels next to visual using bullet point kind of effect using the same colours I used on the visual. There are two ways you can achieve this:

By using shape visual:

Using shape visual is easy as we do all the development in one tool, but resizing to get the smallest shape is a bit tricky. That’s when using image is helpful.

By using an image:

Using an image is a tiny bit more work. But we have more options. I like using Flat Icon or PowerPoint. When you use image, you can go for various shapes and sizes.

That’s all, Nothing fancy excpet layering. I hope this helps. Let me know what you think.

Prathy

3 comments
4 FacebookTwitterPinterestEmail

This is a long-overdue blog post. A couple of months ago, I worked with a client in Amsterdam; one of the use cases was to show key metrics, flags that need attention. The user also wanted to click on warning symbol to confirm, where the issues were, however, the user didn’t want a drill through, it has to be a left-click.

As of yet, except for button/action we can not do left clicks in Power BI. As the user didn’t want the report to open in another browser tab etc., so was thinking about other options and at the end decided to go for tooltips and symbols to show flags like below:

Power BI Visual with warnings

#PowerBI Card visual to show banners/warnings:

Card visual is my go-to visual when it comes to Key metrics with numbers. In this use case, the user wanted to see key metrics, warnings and the respective details of warnings.

Two things I considered while designing this:

  1. Highlight only the values that needed attention
  2. Keep the design and clicks simple

When it comes to flags, many times, I see people highlighting all values. In my opinion highlighting should add the benefit; it should not make the report or visual cluttered. So I try to focus on data that needs attention. If we look at the below screenshots, we can see the difference very well.

However, in my use case, I want to highlight only some data, but that may not be in your case, and you may want to highlight all warnings.

Next, fewer clicks or no clicks. In this use case, I needed a dynamic, data-driven display of details. Tooltips are perfect for this use case, and the user doesn’t have to do much other than hovering over the warning sign.

Design:

So first I created a DAX measure to show the symbols I wanted to show, something like this:

Warning2 =

VAR V =IF([% Change]=BLANK(),BLANK(),
IF([% Change]>0.1,"Great",
IF([% Change]>0.03&&[% Change]<0.10,"Good",
IF([% Change]<0.03,"Bad"))))
Return

IF(V=“Good",”★",”")

Once I have my measure ready, I created one Card to show my measure value and the other one to show the warning, like below:

2019 10 21 14 37 34

Then I used conditional formatting to make the colour of the symbol based on my measure

2019 10 21 14 41 03

The user was pretty pleased with the approach since then I used this kind of design at various places so thought to write a blog post to, hoping it will inspire someone out there. Key metrics are very important in the report design, keep an eye on my next blog post where I will be writing my approaches about “Visualising Key Metrics using Power BI”.

You can view the report here.

Prathy

3 comments
1 FacebookTwitterPinterestEmail

Like many things in Power BI, Power BI Tool Tips functionality evolved so much. I probably do a post on Tool Tips sometime soon. Today it’s about visual header tooltip. While I was working on a project recently, I came across a new ToolTip icon under visual headers. Since then, I have been using a lot, so I thought to blog about it.

Let’s start with what is Tool Tip:

A tooltip is a graphical user interface (GUI) element used in conjunction with the cursor or mouse pointer to display information about an item without needing to click on it. The typical scenario for summoning a tooltip is to hover the mouse cursor over another GUI element such as a tool icon in software application, and it is also prevalently used in websites.
A tooltip is also known as a hint, infotip or screentip.

I think in Power BI, visual header Tool Tip Icon works more like a hint, info tip or screen tip. You can enable this on each visual under Visual Header in Visual properties. This blog post explains how to enable it – https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-june-2019-feature-summary/#headerTooltips

What I want to talk about is use cases:

  • Visual annotations
  • Business logic explanation / Calculations
  • How  to navigate around the visual
  • Show more data related to visual
  • Anything or everything else

Visual annotations: 

When we look at data journalism posts, most of the times they have annotations, explaining what visual showing or talking about measures. Again most of these data storeys are used for paper. But in the digital world, we do see these annotations more interactively. It is nice to have this kind of lil annotations for everyday reporting as well, and Tooltip Icon can be used for that purpose. Another thing is using canvas space wisely, it is important, and having this kind of hint helps us on saving the canvas space.

So following visual, I am using the ToolTip icon to do annotations. When the user clicks on the header tooltip icon, it will show annotations related to visual

Business logic  / Calculations explanation:

Another good use case is to explain business logic. In the BI world, everyone works towards a single version of the truth, but many times it’s illusory. Another silly thing is naming conventions, like Microsoft products, in the business as well one metric may mean different things in different teams. So having a bit of explanation about metric can be very very handy and Tooltip icon can be used for it.

In the following visual, I am showing how the total got calculated using the Tooltip icon.

How to navigate around the visual:

Not all visuals are as self-explanatory as helpful bar charts. Many need explanations, not only visuals but with all other extra features like drill down, drill through, Tooltips, etc benefits with a bit of guidance. Again, the ToolTip icon comes handy here.

In the below example, I am using the tooltip icon to show how to navigate around the visual

Show more data related to visual:

Simplicity is the key! When you want to focus on one thing, then showing only that helps. But I am sure there is always this one business user who wants to see that one other metric on the report page. 

For example, in the below visual, I want to highlight the trend lines, but the business user also wants to know the number of rows in Male and female. Then that could be something I can show using Tooltip icon

Or

Anything else you want to display 🙂

Hope you enjoyed reading; let me know how you are using this functionality…

Till next time,
Prathy 🙂

5 comments
7 FacebookTwitterPinterestEmail
Newer Posts