Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
radzyck
Frequent Visitor

Dynamic buckets based on slicer

Hi guys,

 

I have this table

 

usr box app device
u1  b1  a1  d1
u1  b1  a1  d2
u1  b1  a2  d3
u1  b2  a2  d4
u2  b1  a1  d5
u2  b2  a3  d6
u2  b2  a4  d7
u2  b3  a1  d8
u3  b3  a1  d9
u3  b4  a1  d10
u3  b3  a2  d11

I've created 2 slicers on column box and app. In a Clustered column chart, on values I have count distinct usr. On legend I want to calculate a breakdown on usr by device. The buckets are 1 device, 2 devices, 3 devices, more that 3 devices.

if no selections in slicers:

  • count distinct usr = 3
  • 2 usr -> more that 3 devices
  • 1 usr -> 3 devices

if b1 is used as filter:

  • count distinct usr = 2
  • 1 usr -> 3 devices
  • 1 usr -> 1 device

if a1 is used as filter:

  • count distinct usr = 3
  • 3 usr -> 2 devices

if a1 and b1 are used as filters:

  • count distinct usr = 2
  • 1 usr -> 2 devices
  • 1 usr -> 1 device

How can I do this?

2 REPLIES 2
radzyck
Frequent Visitor

Hi guys,

 

I have this table

 

usr box app device
u1  b1  a1  d1
u1  b1  a1  d2
u1  b1  a2  d3
u1  b2  a2  d4
u2  b1  a1  d5
u2  b2  a3  d6
u2  b2  a4  d7
u2  b3  a1  d8
u3  b3  a1  d9
u3  b4  a1  d10
u3  b3  a2  d11

I've created 2 slicers on column box and app. In a Clustered column chart, on values I have count distinct usr. On legend I want to calculate a breakdown on usr by device. The buckets are 1 device, 2 devices, 3 devices, more that 3 devices.

if no selections in slicers:

  • count distinct usr = 3
  • 2 usr -> more that 3 devices
  • 1 usr -> 3 devices

if b1 is used as filter:

  • count distinct usr = 2
  • 1 usr -> 3 devices
  • 1 usr -> 1 device

if a1 is used as filter:

  • count distinct usr = 3
  • 3 usr -> 2 devices

if a1 and b1 are used as filters:

  • count distinct usr = 2
  • 1 usr -> 2 devices
  • 1 usr -> 1 device

How can I do this?

Greg_Deckler
Community Champion
Community Champion

I'm pretty sure that this is a case of using a measure coupled with the disconnected table trick. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors