custom
14 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!Change tooltip message based on measure being hovered over in a matrix
Hi, I am trying to get my tooltip value to display a custom value for each unique measure in the "Values" field in my Matrix visual. For example, I have the below fields in my visual. When I hover over a value in my matrix, I want a custom message to pop up based on the measure I have hovered over. Example: When I hover over a value associated with the "Calendar Month Settlement" measure below I want it to show "1" and if I hover over a value associated with the "WTI CMA" measure in the matrix I want it to show "2" etc. So I want my custom message to show up based on the measure I am hovering over. Is there a way I can write this in DAX?496Views0likes1CommentCustomization of access request instructions
I think we should be able to fully customize the instructions a user receives when attempting to access an app / report. We should be able to direct users elsewhere instead of just receiving the default email from MS requesting access. Along with this, the emails received from MS should also be standardized whatever the access request is for. Some have the users email, some do not. This way automations could be used to auto reply to the user requesting access.1.1KViews0likes0CommentsAbility to create a measure based on selection for a visual OR use anotheslicer if none is selected?
Hi Everyone, I'm going to try my best to articulate what I'm looking for, but I have a bar chart where my x axis is fiscal years (last 10 years) and my Y axis is how much money was spent for each. I also have a gauge that shows total spent and paid visual as well. My issue I'm having is I want my gauge to default to this fiscal year we're in, but update if another fiscal year from the bar chart is selected. My problem i'm having is I dont know if there is a way to set it to default if nothing is selected. Right now with all the bar chart's FYs showing the gauge is totaling all of them up together which is inaccurate since our FYs act in silo's so I dont want mass total. So I want the guage to be this FY or adjust if a single year from the chart is selected and if nothing in the chart is selected then gauge goes back to the current FY. I'm hoping i'm making sense. Is this even possible? What I tried to do is add a FY slicer with today's FY as the first/default so that keeps the guage for this FY and turn off the bar chart to filter from that slicer, but then if i select a year from the bar chart to view the guage is blank. I am hoping there's a way to create a measure and reference the selected item from the chart otherwise use the FY slicer i added or something like that. Thank you!1.4KViews0likes5CommentsRelative 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! KrisSolved