avatorl / Deneb-Vega-Help

Do you need help with Deneb custom visual for Power BI and/or Vega visualization grammar? Create an issue here to get assistance from Deneb community expert Andrzej Leszkiewicz.
4 stars 0 forks source link

Adding Status Monitoring Logic to Org Chart #8

Closed magnus0 closed 2 months ago

magnus0 commented 3 months ago

Hi I've created an org chart using Davide Bacci's template. The chart works as expected, but I want to add status monitoring logic and I'm having trouble with it. By default, the Tier 3 drivers have a status which is used to determine the statuses of the other tiers. Each tier and its respective owner are represented in the data model for accountability and tracking purposes. Attached are an data, image and the PBIX file showing what I'm trying to achieve.

https://drive.google.com/drive/folders/1fxaPBWUnUv_9w_XmvnUF_y1Dpsji0BMT?usp=sharing

Updated Cust S Image

Current State

What I Expected: I expected that:

If any Tier 3 driver is "Off track," the associated Tier 2 driver and its owner would be "Off track."

If no Tier 3 drivers are "Off track" but at least one is "At risk," the associated Tier 2 driver and its owner would be "At risk."

If all Tier 3 drivers are "On track," the associated Tier 2 driver and its owner would be "On track."

Similar logic for updating the statuses of Tier 1 outcomes, objectives, and their respective owners.

What Actually Happened: The logic did not work as expected. The statuses of the Tier 2 drivers, Tier 1 outcomes, objectives, and their respective owners did not update correctly based on the rules I set up.

Status Monitoring Rules:

Tier 2 Driver Status:

"Off track" if any associated Tier 3 Driver is "Off track."

"At risk" if no Tier 3 Drivers are "Off track" but at least one is "At risk."

"On track" if all associated Tier 3 Drivers are "On track."

Tier 1 Outcome Status:

"Off track" if any associated Tier 2 Driver is "Off track."

"At risk" if no Tier 2 Drivers are "Off track" but at least one is "At risk."

"On track" if all associated Tier 2 Drivers are "On track."

Objective Status:

"Off track" if any associated Tier 1 Outcome is "Off track."

"At risk" if no Tier 1 Outcomes are "Off track" but at least one is "At risk."

"On track" if all associated Tier 1 Outcomes are "On track."

I can be reached at magnus.adoughan@gmail.com

avatorl commented 3 months ago

Hi @magnus0,

Thank you for you question, but I'm not sure it's a Deneb/Vega question. Feel free to let me know if I missed anything that makes it Deneb/Vega question.

I think it makes sense to calculate all the statuses before data (including node Status) goes into the visual, likely in a DAX measure or even earlier in Power Query. Doing that using Vega transformations should be possible, but from performance and maintenance point of view is not the best choice. Also, you may want to use Status in the rest of the report outside of this visual. Hence, the question is not about Deneb/Vega, you need to solve this problem outside of Deneb and no matter what visual will be used to visualize the data.

You can use numeric integer values for the status: 0 = "Ot Track", 1="At Risk", 2="Off Track", then for each node on the higher level, Tier 2 node, for example, find MAX(Status) of all the Tier 3 nodes associated with this node. Then, already knowing Status of Tier 2 nodes, do the same for each Tier 1 node - find MAX(Status) of all the Tier 2 nodes associated with this node.