Create a drillthrough button in Power BI

  • Article
  • 7 minutes to read

You can create a drillthrough button in Power BI, a button that drills through to a page with details that are filtered to a specific context.

One way to drill through in a report is to right-click in a visual. If you want the drillthrough action to be more obvious, you can create a drillthrough button instead. The button can increase the discoverability of important drillthrough scenarios in your reports. You can conditionally determine much of how the button looks and acts. For example, you can show different text on a button if certain conditions are met. Read on for details.

In this example, after you select the Word bar in the chart, the See details button is enabled.

See details button

When you select the See details button, you drill through to the Market Basket Analysis page. As you can see from the visual on the left, the drillthrough page is now filtered for Word.

Filtered visual

Set up a drillthrough button

To set up a drillthrough button, you first need to set up a valid drillthrough page within your report. Then, you need to create a button with Drill through as the action type and select the drillthrough page as the Destination.

Because the drillthrough button has two states, enabled vs. disabled, you see two tooltip options.

Set up the drillthrough button

If you leave the tooltips boxes blank, Power BI automatically generates tooltips. Those tooltips are based on the destination and drillthrough field(s).

Here's an example of the autogenerated tooltip when the button is disabled:

"To drill through to Market Basket Analysis [the destination page], select a single data point from Product [the drillthrough field]."

Disabled autogenerated tooltip

And here's an example of the autogenerated tooltip when the button is enabled:

"Click to drill through to Market Basket Analysis [the destination page]."

Enabled autogenerated tooltip

However, if you'd like to provide custom tooltips, you can always input a static string. You can also apply conditional formatting to tooltips.

Pass filter context

The button works like the regular drillthrough: You can pass filters on additional fields by cross-filtering the visuals that contain the drillthrough field. For example, using Ctrl + click and cross-filtering, you can pass multiple filters on Store to the drillthrough page because your selections cross-filter the visual that contains Product, the drillthrough field:

Passing filter context

After you select the drillthrough button, you see filters on both Store and Product being passed through to the destination page:

Filters on this page

Ambiguous filter context

Since the drillthrough button isn't tied to a single visual, if your selection is ambiguous, then the button is disabled.

In this example, the button is disabled because two visuals both contain a single selection on Product. There's ambiguity about which data point from which visual to tie the drillthrough action to:

Ambiguous filter context

Customize formatting for disabled buttons

You can customize the formatting options for the disabled state of drillthrough buttons.

Customize disabled button formatting

These formatting options include:

  • Button text controls: text, color, padding, alignment, size, and font family

    Format disabled button text

  • Button fill controls: color, transparency, and new fill image (more on this in the next section)

    Disabled button fill

  • Icon controls: shape, padding, alignment, line color, transparency, and weight

    Disabled button icons

  • Outline controls: color, transparency, weight, round edges

    Disabled button outline

Set formatting for button text conditionally

You can use conditional formatting to change the button text based on the selected value of a field. To do this, you need to create a measure that outputs the desired string based on the DAX function SELECTEDVALUE.

Here's an example measure that outputs "See product details" if a single Product value is NOT selected; otherwise, it outputs "See details for [the selected Product]":

            String_for_button = If(SELECTEDVALUE('Product'[Product], 0) == 0, "See product details", "See details for " & SELECTEDVALUE('Product'[Product]))                      

Once you've created this measure, you select the Conditional formatting option for the button text:

Select Conditional formatting

Then, you select the measure you created for the button text:

Value based on field

When a single product is selected, the button text reads:

"See details for Word"

When a single value is selected

When either no products are selected, or more than one product is selected, the button is disabled. The button text reads:

"See product details"

When multiple values are selected

You can conditionally format the tooltip for the drillthrough button when it's enabled or disabled. If you've used conditional formatting to dynamically set the drillthrough destination, you may want the tooltip for the button state to be more informative, based on your end user's selection. Here are some examples:

  • You can set the disabled state tooltip to be prescriptive on a case-by-case basis using a custom measure. For example, if you want the user to select a single product and a single store before they can drill through to the Market Analysis page, you can create a measure with the following logic:

    If the user hasn't selected either a single product or a single store, the measure returns: "Select a single product and Ctrl + click to also select a single store."

    If the user has selected a single product, but not a single store, the measure returns: "Ctrl + click to also select a single store."

  • Similarly, you can set the enabled-state tooltip to be specific the user's selection. For example, if you want the user to know which product and store the drillthrough page will be filtered to, you can create a measure that returns:

    "Click to drill through to [drillthrough page name] to see more details on sales for [product name] at [store name] stores."

Set the drillthrough destination conditionally

You can use conditional formatting to set the drillthrough destination based on the output of a measure.

Here are some scenarios where you might want the button drillthrough destination to be conditional:

  • You only want to enable drillthrough to a page when multiple conditions have been met. Otherwise the button is disabled.

    For example, you want users to select a single product and a single store before they can drill through to the Market details page. Otherwise the button is disabled.

    Select a product and store

  • You want the button to support multiple drillthrough destinations based on user selections.

    For example, say you have multiple destinations (Market details and Store details) that users can drill through to. You can have them select a specific destination to drill through to before the button becomes enabled for that drillthrough destination.

    Select product and destination

  • You may also have interesting cases for a hybrid scenario to support both multiple drillthrough destinations and specific conditions where you want the button to be disabled. Read on for details about these three options.

Disable the button until multiple conditions are met

Let's look at the first case, where you want to keep the button disabled until additional conditions are met. You need to create a basic DAX measure that outputs an empty string ("") unless the condition has been met. When it's met, it then outputs the name of the drillthrough destination page.

Here's an example DAX measure that requires a Store to be selected before the user can drill through on a Product to Store details page:

            Destination logic = If(SELECTEDVALUE(Store[Store], "")=="", "", "Store details")                      

When you've created the measure, you select the conditional formatting (fx) button next to Destination for the button:

Select the conditional formatting button

For the last step, you select the DAX measure you created as the field value for the destination:

Destination based on field

Now you see the button is disabled even when a single product is selected, because the measure also requires you to select a single store:

Drillthrough button disabled

Support multiple destinations

For the other common case where you want to support multiple destinations, you start by creating a single-column table with the names of the drillthrough destinations:

Create a table

Power BI uses exact string match to set the drillthrough destination, so double-check that the entered values exactly align with your drillthrough page names.

After you've created the table, add it to the page as a single-select slicer:

Drillthrough slicer

If you need more vertical space, convert the slicer to a dropdown. Remove the slicer header and add a text box with the title next to it:

Drillthrough slicer with no header

Alternatively, change the list slicer from vertical to horizontal orientation:

Horizontal slicer

For the destination input for the drillthrough action, select the conditional formatting (fx) button next to Destination for the button:

Select the conditional formatting button

Select the name of the column you created, in this case, Select a destination:

Select a destination

Now you see that the drillthrough button is only enabled when you've selected a product and a destination:

Select product and destination

Hybrid of the two scenarios

If you're interested in a hybrid of the two scenarios, you can create and reference a DAX measure to add additional logic for the destination selection.

Here's an example DAX measure that requires the user to select a Store before they can drill through on a Product to any of drillthrough pages:

            Destination logic = If(SELECTEDVALUE(Store[Store], "")=="", "", SELECTEDVALUE('Table'[Select a destination]))                      

Then you select the DAX measure you created as the field value for the destination. In this example, the user would need to select a Product, a Store, and a destination page before the drillthrough button is enabled:

Select product, store, and destination

Considerations and limitations

  • This button doesn't allow for multiple destinations using a single button.
  • This button only supports drillthroughs within the same report; in other words, it doesn't support cross-report drillthrough.
  • The disabled state formatting for the button is tied to the color classes in your report theme. Learn more about color classes.
  • The drillthrough action works for all built-in visuals, and works with some visuals imported from AppSource. However, it isn't guaranteed to work with all visuals imported from AppSource.

Next steps

For more information about features that are similar or interact with buttons, take a look at the following articles:

  • Create buttons
  • Use drillthrough in Power BI reports
  • Use bookmarks to share insights and build stories in Power BI