gopy6243's avatar
gopy6243
Icon for Advocate IV rankAdvocate IV
9 months ago

Unlimited Visuals in one chart

 

Here’s the short “recipe” you can reuse to get unlimited visuals inside one chart.

Define patterns, not visuals:
-Create a small Selection table with one row per pattern: Selection ID and Selection Name (e.g. “Sales Drivers (2 bars + 2 lines)”, “Profit Engine”, “Pattern 27”, etc.).
-Use this table as a slicer.

Fix your KPI set
-Decide a finite set of base KPIs (Sales, Cost, Profit, Units, Products, etc.).
-Create normal measures for each KPI.

-Create “router” Visual Calculations
-For each KPI and for each role (Bar or Line), create one Visual Calculation that simply says:
IF( SelectedID is in the list of patterns where this KPI should appear in this role, then show the KPI, otherwise BLANK ).

Example:
VC Sales (Bar) = IF( SelectedID IN {1,4,6}, [Total Sales], BLANK() )

-Wire the visual once
-Put all Bar VCs in the Column Y-axis.
-Put all Line VCs in the Line Y-axis.
-You never touch the axes again.

To add a new visual pattern later
Add one row to the Selection table.
Update the IN {…} lists in the affected Visual Calculations.

Result
One combo chart that can morph into any number of visual layouts (6, 20, 60, 100+) just by changing the selection.

 

By Hadi Kheireddine

LinkedIn

2 Replies

  • Very Nice and well done . 1 question : is it also possible that legends shows only the labels that are shown in the visual? So if you select the fist option that the legend shows the 3 selected items .

    • gopy6243's avatar
      gopy6243
      Icon for Advocate IV rankAdvocate IV

      Thanks, it's not possible to dynamically hide legend , you can turn it off and use series label instead for this case , in Format Visual , click on data labels  then for each one assign a title as series label