Category: Uncategorized

Using Bookmarks in Power BI for an Enhanced Experience Selecting Common Date Periods

Many popular uses of bookmarks involve showing and hiding content based on user clicks on buttons.  A scenario I recently encountered and solved with bookmarks had to do with providing users the ability to quickly filter a page’s contents by a date period.  Users wanted to be able to switch between “this month”, “last month”, and a free-month selection.

For the first two options, a relative date filter can do the work but would require at least two clicks, and the free-month option would entail some type of dropdown list.  Moreover, two slicers would take a lot of space and both being about the same date might be confusing to the user.  This effort was part of an update to an existing report and there wasn’t much free space available.

The solution was to have three buttons to let the user switch between these filters.  The final version looked something like this, in its three possible states when the current month is May of 2019 (“Current” is the default view):




To implement this, we had a hidden relative date filter visual that was toggled via bookmarks from “Is in the last 1 month(s)” to “Is in this month” by the Prior and Current buttons, respectively.  This is turn updated the value shown by the card on the left.  For example:

Note the visible card and the hidden slicer.

The “Select…” button’s bookmark (Monthly Select) hides the card, clears the relative date filter, and shows a dropdown slicer.

See the effect in action:

This technique may be generalized for use in any kind of situation where filter presets may enhance the user’s experience.

Please follow and like us:

Using a Power BI Scatter Chart to Visualize Control of Congress

In this post I will show you how I built this pretty chart that depicts which party controled each house of the United States Congress (the Senate and the House of Representatives) between 1968 and 1980:

Final Chart

The chart displays, per year, the party that controls each house and the relative majority under which control is held.  The first item is given by the color of the dots and the second by their size.  Hovering over any of the dots shows this:


I got the raw data from Wikipedia, and it looks like this:


I had to format the data in a special way to build the chart, especially for the year-by-year continuity.  This is because elections are not held every year but are staggered.  In the Senate, seats are held for six years but elections occur every two years for approximately one-third of the seats.  In the House, elections are held every two years for all members.  So after some M programming and a bit of DAX I got it into this shape:


To build the scatter chart, we need two measures, one for the X axis and one for the Y axis.  For the X axis, I used the Begin Year and for the Y axis the House Type (1 for Senate, 2 for House).   Using Controlling Party for the legend provided the colors and the size was given by the Majority Percentage.  This is the final configuration:


The last touch was to use an overlaid text box to label the final Y axis:

Y Axis

As a final note, the Quick Insights feature of Power BI gave me the idea for this chart:


View the complete report here.

Please follow and like us: