Forum Discussion
Competitive and Market Chart Annotation
- 1 year ago
Hi Perplexed , Thank you for reaching out to the Microsoft Community Forum.
You should set up your data model to avoid ambiguity. Create a DimQuarter table with unique quarters and link it to both your Revenue and Events tables via the Quarter column (1-to-many). Skip direct Market or Vendor relationships between tables to prevent path errors. Instead, make two disconnected tables, Slicer_Market and Slicer_Vendor, with unique Market and Vendor values for your slicers. This clean setup ensures no ambiguity and supports the new Text Slicer’s multi-select feature from January 2025.
Create DAX measures to handle dynamic filtering and clean event tooltips. These measures should be able to make your chart and tooltips update instantly with slicer selections and CONCATENATEX ensures events display fully without Power BI’s default First/Last/Count summarization.
Example:
FilteredRevenue =
CALCULATE(
SUM(Revenue[Revenue]),
FILTER(
Revenue,
Revenue[Market] IN VALUES(Slicer_Market[Market]) &&
Revenue[Vendor] IN VALUES(Slicer_Vendor[Vendor])
)
)
EventTooltip =
CONCATENATEX(
FILTER(
Events,
Events[Quarter] = SELECTEDVALUE(DimQuarter[Quarter]) &&
Events[Market] IN VALUES(Slicer_Market[Market]) &&
Events[Vendor] IN VALUES(Slicer_Vendor[Vendor])
),
Events[Event],
", "
)
For the visuals, create a line chart with DimQuarter[Quarter] on the X-axis and FilteredRevenue on the Y-axis. Overlay a scatter plot for events: use DimQuarter[Quarter] for the X-axis, a constant Y-value (e.g., 10% above max revenue for visibility) and EventTooltip for the tooltip. If you want sharper annotations, use the Deneb custom visual with Vega-Lite spec. Map the Events table to Deneb, using Quarter and EventTooltip. This setup ensures your annotations update dynamically with slicers and show exact event names. To keep it snappy with larger datasets, pre-aggregate data in Power Query and index Quarter columns.
Example Vega-Lite spec:
{
"data": {"name": "dataset"},
"mark": {"type": "point", "filled": true, "size": 100},
"encoding": {
"x": {"field": "Quarter", "type": "ordinal", "axis": {"title": "Quarter"}},
"y": {"value": 0},
"tooltip": [{"field": "EventTooltip", "type": "nominal", "title": "Events"}]
}
}
If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Thank you for the help here. I thought my model was set up as described. However, I noticed that in my test data import had autopoulated one relationship to be 1:1 and both directions in another. once I corrected this to 1:many and single direction things started working as I thought they should. Again, apreciate the responses.