skip to Main Content

Computer-Play-Button_thumb2

Disconnected Slicers With DAX Variables & SELECTEDVALUES

Hello P3 Nation! Today’s “post” is actually going to be a video link. Sometimes there are certain subjects, concepts, or post ideas that just don’t translate well to the written word, and especially to screenshots. So this post will be in moving picture form! We’ve posted it to our YouTube Channel which you can go to here. Bedside’s today’s video, we have TONS of content on that channel so please take a look at our other awesome videos as well.

Today’s topic covers how to create a Disconnected Slicer using DAX Variables and SELECTEDVALUES. We’ve easily written a few dozen articles over the years on ways to use disconnected slicers, and here’s another one! The great thing about DAX is that as it EVOLVES, writing measures and utilizing certain features becomes easier. That’s the goal of this video, it’s not re-inventing the wheel, just refining it. I’ve included below the original DAX Formula I used in the walkthrough. Otherwise, enjoy the video!

Value Selection =
VAR Selection =
SELECTEDVALUE ( ‘Value Selection'[Value Selection], “All” )
RETURN
SWITCH (
TRUE (),
Selection = “Actuals”, [Sales Amount],
Selection = “Budget”, [Budget Amount],
Selection = “Forecast”, [Forecast Amount],
[Sales Amount] )

Reid Havens

Reid Havens is the Founder & CEO of Havens Consulting Inc. He has a formal background in technology and organizational management, having obtained separate degrees in Organizational Development & Business Analytics. Reid has experience working with Fortune 500 companies such as Microsoft as well as with Non-Profit Organizations. He is also the Executive Editor, contributing author, and Principal Consultant at PowerPivotPro. Additionally he's an instructor at the University of Washington and other universities, teaching Business Intelligence, Reporting, & Data Visualization.

This Post Has 6 Comments
  1. Reid.. Nice Video.. Your timing is awesome.. Working with similar disconnected slicers today. I love them. Like your use of SelectedValue. Very Clean.

  2. Love idea of showing improved way of doing things. Just used this post to redo my disconnected slicer in a report. Old dogs like me tend to use first way of doing things, especially since I’ve just recently been able to use variables in DAX when we upgraded our servers to Azure Analysis Services.

  3. Quick question…there’s no way to make Dynamic legends are there? I’ve searched but I keep coming up blank. I come from the Qlikview world and it’s super easy to group dimensions to make a flip between Location/Department/Provider for example if you want to keep the measures the same. Anyone have any ideas here?

    1. Hi Nate, not directly in the visualization. There’s ways to use dax to return a list of values for you, based on selection. That would be my design approach if what you described was a client request.

Leave a Comment or Question