Forum Discussion

reikerpg's avatar
reikerpg
New Member
22 days ago
Solved

Best User-Friendly Horizontal Bar Graph Drill-Down Dashboard Methodology

How would I conceptually define the following in Power BI? Say I have two columns in a dataset. I would like to see a horizontal bar graph of number of rows sorted by the first column. When I click o...
  • reikerpg's avatar
    18 days ago

    After much searching around and experimentation, the best option that I found was a "Decomposition Tree - All Expanding" visual from the "Get More Visuals" button.  (I then hid the display options at the top and set display units to none in the Visual/Data Labels settings.)

    (I was able to work around the two columns being in separate data sets with no bidirectional join possible and the limitations of live online connections to two different datasets, using a variant of the following code.)
    All on My ID column:
    Portfolios 1 -> * Contacts (ALREADY THERE)
    My ID Bridge 1 -> * Portfolios (New)
    My ID Bridge 1 -> * Contacts (New and Inactive)
    My ID Bridge Code:
    My ID Bridge =
    FILTER(
         DISTINCT(
              UNION(
                   SELECTCOLUMNS(
                         'Portfolios',
                         "My ID", 'Portfolios'[My ID]
                   ),
                   SELECTCOLUMNS(
                        'Contacts',
                        "My ID", 'Contacts'[My ID]
                   )
              )
         ),
         NOT ISBLANK([My ID])
    )
    Add this measure to Contacts:
    Contact Count =
    CALCULATE(
         COUNTROWS('Contacts'),
         TREATAS(
              VALUES('Portfolios'[My ID]),
              'Contacts'[My ID]
         )
    )
    I also added a flipside of this measure to Portfolios.