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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
danteverdi
Regular Visitor

Deneb Stacked Bar Chart Group by Parameter with Pattern Fill

Hi,

I just started out using deneb about a week ago and have the following use case. I want to display planned hours by period and project and group the projects that are smaller than a dynamic parameter value. This is my progress so far:

danteverdi_0-1739867455553.png

I managed to make the grouping by parameter value, but as you can see in the screenshot, there is an issue with the periods '202510' and '202511'.  The labels and bar are pushed on the edge of the visual. I noticed that these visual errors occur, if there is no project with values lower than the parameter value, but I don't know how to resolve this issue.

 

This is how my deneb json code looks like:

 

 

{
  "data": {
    "name": "dataset"
  },
  "transform": [
    {
      "calculate": "datum['Planned Hours'] >=  datum['Parameter Value'] ? datum['Project'] + ', ' + format(datum['Planned Hours'], '.0f') : 'Z Merged < ' + datum['Parameter Value'] + ' Hours, ' + format(datum['Others Planned Hours'], '.0f')",
      "as": "Projects"
    },
    {
      "calculate": "datum['Planned Hours'] >=  datum['Parameter Value'] ? datum['Project'] : 'Z Merged <'",
      "as": "ProjectColor"
    }
  ],
  "layer": [
    {
      "mark": {
        "type": "bar",
        "tooltip": true,
        "stroke": "black"
      },
      "encoding": {
        "y": {
          "field": "Planned Hours",
          "type": "quantitative",
          "title": null,
          "stack": true,
          "aggregate": "sum"
        },
        "color": {
          "field": "ProjectColor",
          "legend": null
        }
      }
    },
    {
      "mark": {
        "type": "text"
      },
      "encoding": {
        "text": {
          "field": "Projects"
        },
        "y": {
          "field": "Planned Hours",
          "type": "quantitative",
          "aggregate": "sum",
          "title": null,
          "stack": true,
          "bandPosition": 0.5
        }
      }
    }
  ],
  "encoding": {
    "x": {
      "field": "Period",
      "type": "nominal",
      "title": null,
      "axis": {
        "labelAngle": 0
      }
    }
  }
}

 

 

Another requirement that I have is to differentiate the projects between rough and detailed planning, depending on the Flag "IsDetailedPlanning" in the "factPlanning" table. I want to achieve for the projects with rough planning part to be shown in a dottet pattern. The detailed planning part of the project should have no pattern fill. The color of the bars should be dependent on the project (as it is now). Is this achievable?

 

Thank you very much for your help in advance! If you need further information don't hesitate to ask.

 

Report with example data: https://we.tl/t-tj8mLUFi38

0 REPLIES 0

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)