custom
6 TopicsPower BI - Deneb visual - Read a JSON to create the visuals
Hi everyone, I have a graphic which work correctly. I use at the moment a table in power BI dedicated for this visual. It seems possible for deneb to read JSON data because when I provide the original table with the JSON column, I can see the data but when I try to use JSON.parse(), I have lot of errors Please find my current code which work perfectly from my Power BI. { "$schema": "https://vega.github.io/schema/vega/v5.json", "description": "Final trusted version with a correctly implemented 'No Schedule Data' message.", "width": 372, "height": 48, "signals": [ { "name": "pbi_time_offset_seconds", "init": "isValid(data('pbi_summarize')[0]) ? data('pbi_summarize')[0].DST_ClockDiffBtwLocationAndLocalOffset : 0" }, { "name": "utc_now", "init": "now()", "on": [ { "events": {"type": "timer", "throttle": 10000}, "update": "now()" } ] }, { "name": "remote_now", "update": "utc_now + (pbi_time_offset_seconds * 1000)" }, { "name": "remote_day", "update": "day(remote_now)" }, { "name": "remote_hour_decimal", "update": "hours(remote_now) + (minutes(remote_now) / 60) + (seconds(remote_now) / 3600)" }, { "name": "remote_time_label", "update": "timeFormat(remote_now, '%H:%M')" }, { "name": "has_data_for_today", "update": "data('daily_schedule').length > 0" } ], "data": [ { "name": "dataset" }, { "name": "pbi_summarize" }, { "name": "daily_schedule", "source": "dataset", "transform": [ {"type": "filter", "expr": "datum.day_num != null && datum.day_num == remote_day"} ] }, { "name": "schedule_bands", "source": "daily_schedule", "transform": [ { "type": "filter", "expr": "datum.ScheduleType == 'Production' || datum.ScheduleType == 'ITSupport'" }, { "type": "formula", "as": "display_type", "expr": "datum.type == 'Normal' ? (datum.ScheduleType == 'Production' ? 'Working hours' : 'Support hours') : datum.type == 'Flexible' ? 'Flexible hours' : 'No Working hours'" } ] }, { "name": "site_opening_start", "source": "daily_schedule", "transform": [ {"type": "filter", "expr": "datum.ScheduleType == 'SiteOpening'"}, {"type": "project", "fields": ["startTime"], "as": ["time_value"]} ] }, { "name": "site_opening_end", "source": "daily_schedule", "transform": [ {"type": "filter", "expr": "datum.ScheduleType == 'SiteOpening'"}, {"type": "project", "fields": ["endTime"], "as": ["time_value"]} ] } ], "scales": [ { "name": "xscale", "type": "linear", "range": "width", "domain": [0, 24] }, { "name": "yscale", "type": "band", "range": [1, 50], "domain": ["ITSupport", "Production"], "padding": 0.1 }, { "name": "color", "type": "ordinal", "domain": ["Working hours", "Support hours", "Flexible hours", "No Working hours"], "range": ["#a6cee3", "#b2df8a", "#1f78b4", "#d3d3d3"] } ], "axes": [ { "orient": "bottom", "scale": "xscale", "tickCount": 25, "title": { "signal": "timeFormat(remote_now, 'Time & Day (%Y-%m-%d)')" }, "labelFontSize": 9, "titleFontSize": 9 } ], "marks": [ { "type": "group", "name": "custom_legend", "encode": {"enter": {"x": {"value": 0}, "y": {"value": -40}}}, "marks": [ {"type": "rect", "encode": {"enter": {"x": {"value": 0}, "y": {"value": 0}, "width": {"value": 10}, "height": {"value": 10}, "fill": {"value": "#a6cee3"}}}}, {"type": "text", "encode": {"enter": {"x": {"value": 15}, "y": {"value": 9}, "text": {"value": "Working hours"}, "fontSize": {"value": 10}, "align": {"value": "left"}}}}, {"type": "rect", "encode": {"enter": {"x": {"value": 120}, "y": {"value": 0}, "width": {"value": 10}, "height": {"value": 10}, "fill": {"value": "#1f78b4"}}}}, {"type": "text", "encode": {"enter": {"x": {"value": 135}, "y": {"value": 9}, "text": {"value": "Flexible hours"}, "fontSize": {"value": 10}, "align": {"value": "left"}}}}, {"type": "rect", "encode": {"enter": {"x": {"value": 240}, "y": {"value": 0}, "width": {"value": 10}, "height": {"value": 10}, "fill": {"value": "#d3d3d3"}}}}, {"type": "text", "encode": {"enter": {"x": {"value": 255}, "y": {"value": 9}, "text": {"value": "No Working hours"}, "fontSize": {"value": 10}, "align": {"value": "left"}}}}, {"type": "rect", "encode": {"enter": {"x": {"value": 0}, "y": {"value": 15}, "width": {"value": 10}, "height": {"value": 10}, "fill": {"value": "#b2df8a"}}}}, {"type": "text", "encode": {"enter": {"x": {"value": 15}, "y": {"value": 24}, "text": {"value": "Support hours"}, "fontSize": {"value": 10}, "align": {"value": "left"}}}}, {"type": "rule", "encode": {"enter": {"x": {"value": 122}, "y": {"value": 13}, "x2": {"value": 122}, "y2": {"value": 23}, "stroke": {"value": "black"}}}}, {"type": "symbol", "encode": {"enter": {"x": {"value": 122}, "y": {"value": 22}, "shape": {"value": "triangle-up"}, "size": {"value": 25}, "fill": {"value": "black"}}}}, {"type": "rule", "encode": {"enter": {"x": {"value": 128}, "y": {"value": 15}, "x2": {"value": 128}, "y2": {"value": 24}, "stroke": {"value": "black"}}}}, {"type": "symbol", "encode": {"enter": {"x": {"value": 128}, "y": {"value": 15}, "shape": {"value": "triangle-down"}, "size": {"value": 25}, "fill": {"value": "black"}}}}, {"type": "text", "encode": {"enter": {"x": {"value": 135}, "y": {"value": 24}, "text": {"value": "Site Opening"}, "fontSize": {"value": 10}, "align": {"value": "left"}}}} ] }, { "type": "text", "interactive": false, "encode": { "enter": { "x": {"field": {"group": "width"}, "mult": 0.5}, "y": {"field": {"group": "height"}, "mult": 0.5}, "text": {"value": "No Schedule Data for Today"}, "fontSize": {"value": 12}, "fontWeight": {"value": "bold"}, "fill": {"value": "gray"}, "align": {"value": "center"} }, "update": { "opacity": [{"test": "has_data_for_today", "value": 0}, {"value": 1}] } } }, { "type": "rect", "from": {"data": "schedule_bands"}, "encode": { "enter": { "x": {"scale": "xscale", "field": "startTime"}, "x2": {"scale": "xscale", "field": "endTime"}, "y": {"scale": "yscale", "field": "ScheduleType"}, "height": {"scale": "yscale", "band": 1}, "fill": {"scale": "color", "field": "display_type"} }, "update": { "opacity": [{"test": "has_data_for_today", "value": 1}, {"value": 0}] } } }, { "type": "rule", "from": {"data": "site_opening_start"}, "encode": { "enter": {"x": {"scale": "xscale", "field": "time_value"}, "y": {"value": 0}, "y2": {"value": 50}, "stroke": {"value": "black"}, "strokeWidth": {"value": 2}}, "update": {"opacity": [{"test": "has_data_for_today", "value": 1}, {"value": 0}]} } }, { "type": "symbol", "from": {"data": "site_opening_start"}, "encode": { "enter": {"x": {"scale": "xscale", "field": "time_value"}, "y": {"value": 50}, "shape": {"value": "triangle-up"}, "size": {"value": 50}, "fill": {"value": "black"}}, "update": {"opacity": [{"test": "has_data_for_today", "value": 1}, {"value": 0}]} } }, { "type": "rule", "from": {"data": "site_opening_end"}, "encode": { "enter": {"x": {"scale": "xscale", "field": "time_value"}, "y": {"value": 0}, "y2": {"value": 50}, "stroke": {"value": "black"}, "strokeWidth": {"value": 2}}, "update": {"opacity": [{"test": "has_data_for_today", "value": 1}, {"value": 0}]} } }, { "type": "symbol", "from": {"data": "site_opening_end"}, "encode": { "enter": {"x": {"scale": "xscale", "field": "time_value"}, "y": {"value": 3}, "shape": {"value": "triangle-down"}, "size": {"value": 50}, "fill": {"value": "black"}}, "update": {"opacity": [{"test": "has_data_for_today", "value": 1}, {"value": 0}]} } }, { "type": "rule", "encode": { "update": { "x": {"scale": "xscale", "signal": "remote_hour_decimal"}, "y": {"value": 2}, "y2": {"value": 50}, "stroke": {"value": "red"}, "strokeWidth": {"value": 2} } } }, { "type": "text", "encode": { "update": { "x": {"scale": "xscale", "signal": "remote_hour_decimal"}, "y": {"value": 3}, "text": {"signal": "remote_time_label"}, "baseline": {"value": "bottom"}, "align": {"value": "center"}, "fill": {"value": "red"} } } } ] } Please find an example of my JSON file stored in Sharepoint (Text multi-lines) {"schedule_rules":[{"day_num":"0","segments":[{"approval_needed":null,"communication_needed":"Mandatory","end_time":"23:59","start_time":"00:00","type":"No Production"}]},{"day_num":"1","segments":[{"approval_needed":"Yes","communication_needed":null,"end_time":"12:30","start_time":"08:30","type":"Normal"},{"approval_needed":"Yes","communication_needed":null,"end_time":"16:30","start_time":"13:30","type":"Normal"}]},{"day_num":"2","segments":[{"approval_needed":"Yes","communication_needed":null,"end_time":"12:30","start_time":"08:30","type":"Normal"},{"approval_needed":"Yes","communication_needed":null,"end_time":"16:30","start_time":"13:30","type":"Normal"}]},{"day_num":"3","segments":[{"approval_needed":"Yes","communication_needed":null,"end_time":"12:30","start_time":"08:30","type":"Normal"},{"approval_needed":"Yes","communication_needed":null,"end_time":"16:30","start_time":"13:30","type":"Normal"}]},{"day_num":"4","segments":[{"approval_needed":"Yes","communication_needed":null,"end_time":"12:30","start_time":"08:30","type":"Normal"},{"approval_needed":"Yes","communication_needed":null,"end_time":"16:30","start_time":"13:30","type":"Normal"}]},{"day_num":"5","segments":[{"approval_needed":"Yes","communication_needed":null,"end_time":"12:30","start_time":"08:30","type":"Normal"},{"approval_needed":"Yes","communication_needed":null,"end_time":"16:30","start_time":"13:30","type":"Normal"}]},{"day_num":"6","segments":[{"approval_needed":null,"communication_needed":"Mandatory","end_time":"23:59","start_time":"00:00","type":"No Production"}]}]} How to import this JSON in Deneb ? I tried with JSON.parse but fails each time Thank you for your supportSolvedUnable to edit scatter plot averages
Hi all, I am trying to change the colour of the line on my scatter plot and add data labels. For some reason, I am unable to edit them and it displays them as 'off', even though they are on my chart. I am also unable to delete the average lines or change their names - when I try they just reappear with the original name. The only way I have been able to delete averages is to reset to default. I have cleared my PowerBI caches, checked my version (2.137.1102.0 64-bit, October 2024) and restarted my laptop. I have other scatter graphs on the same page that are functioning correctly. Please help!Relative Data Slicer using Variable
Hello, We have a relative date slicer for months. When we present our visual we use a large touch screen board. I am trying to find a way to add a radio button, drop down, or some other functionality to the relative date. I want the user to be able to select 1,2,3,6, or 12 months instead of typing it in the field (populated with 1 in the iamge below). After much digging online I have not found anything that works. Is this possible, if so how do you do it?654Views0likes1CommentDisable uncertified custom visualisations with intune
Hi there, I hope this is the right place to ask this. Instead of using Azure AD Group Policy, our organisation uses Microsoft Intune. Therefore, the documentation on how to disable uncertified Power BI custom visualisations doesn't apply: Does anybody know how to apply this same rule in Microsoft Intune? I'm unable to find any resources online that seem to point me in the right direction. Thanks in advance! KrisSolvedMultiple Shapes on one Graph
Hi, I am new to Power BI and trying to develop an report. Below is my requirement. we want to add different shapes in a single graph for 5 different columns. There are 5 Columns A,B,C,D,E. Cloumns A is the line graph and B,C are also line graphs but dotted which acts as UL and LL for column A. We want shade area between B and C. For column D it should be blod line. For column E it should be traingle/any shape to differentiate all 4 other columns. can you please help me with this. X axis is time and Y axis is values of the columns(numeric). Below is sample graph. I developed in excel. Orange color is column E which we want to differentiate using any shape.SandDance Restrictions and Limitations
I think that Sand Dance could easily be Power BI's most powerful visual tool. It currently has some hard-core limitations that restrict the usabliity of this potential titan-esq visual and presentation tool. I was informed a year ago by Steven Drucker that the Power BI : SandDance synergy team was eliminated to focus on Dynamics. I would love to see this revitalized as the potential is currently just teasing us!