User Profile
b244293
Frequent Visitor
Joined 6 years ago
User Widgets
Contributions
Power BI Custom visual for dropdown creation
Hi, I am trying to create the dropdown control in PowerBI Custom Visual. I can create the control but the interaction is not working. Assume, the page contains multiple controls with this dropdown. if I change the selection in the dropdown, the remaining the controls should be reflected. Below the code that I have created, "use strict"; import "core-js/stable"; import "./../style/visual.less"; import powerbi from "powerbi-visuals-api"; import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions; import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions; import IVisual = powerbi.extensibility.visual.IVisual; import EnumerateVisualObjectInstancesOptions = powerbi.EnumerateVisualObjectInstancesOptions; import VisualObjectInstance = powerbi.VisualObjectInstance; import DataView = powerbi.DataView; import VisualObjectInstanceEnumerationObject = powerbi.VisualObjectInstanceEnumerationObject; import ISQExpr = powerbi.data.ISQExpr; import ISemanticFilter = powerbi.data.ISemanticFilter; import { interactivityBaseService, interactivitySelectionService } from "powerbi-visuals-utils-interactivityutils"; import appendClearCatcher = interactivityBaseService.appendClearCatcher; import createInteractivitySelectionService = interactivitySelectionService.createInteractivitySelectionService; import $ from "jquery"; import powerbiInterface from "../node_modules/powerbi-visuals-utils-interactivityutils/lib/index"; import { VisualSettings } from "./settings"; export class Visual implements IVisual { private target: HTMLElement; private settings: VisualSettings; constructor(options: VisualConstructorOptions) { console.log('Visual constructor', options); this.target = options.element; } public update(options: VisualUpdateOptions) { let dataChanged = (options.type == powerbi.VisualUpdateType.Data || options.type == powerbi.VisualUpdateType.All || $('.chart').length == 0); console.log('data changed = ' + dataChanged); if (dataChanged) { $('div, svg, select', this.target).remove(); console.log('Removed..'); } let margin = { top: 0, left: 0, bottom: 5, right: 0 }; let containerSize = { width: options.viewport.width - margin.left - margin.right, height: options.viewport.height - margin.top - margin.bottom }; console.log('container size : ' + containerSize); let $container, $comboBox; if (dataChanged) { $comboBox = $('<select class="tokenCombo"></select>').appendTo(this.target); } else { $comboBox = $('.tokenCombo'); } $comboBox.css({ 'width': containerSize.width + 'px', 'height': '45px', }); if (dataChanged) { let dataViews = options.dataViews; let dataCategorical = dataViews[0].categorical; let category = dataCategorical.categories[0]; let categories = category.values; for (let i = 0; i < categories.length; i++) { let $option = $('<option value="' + categories[i].toString() + '">' + categories[i].toString() + '</option>') .appendTo($comboBox); } } } private static parseSettings(dataView: DataView VisualSettings { return <VisualSettings>VisualSettings.parse(dataView); } /** * This function gets called for each of the objects defined in the capabilities files and allows you to select which of the * objects and properties you want to expose to the users in the property pane. * */ public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions VisualObjectInstance[] | VisualObjectInstanceEnumerationObject { return VisualSettings.enumerateObjectInstances(this.settings || VisualSettings.getDefault(), options); } } Also, I am trying to add the "IInteractiveBehavior" to give the interaction, but I couldn't achieve it?. Kindly help me to proceed?2.7KViews0likes1CommentPower BI Custom Visual - dropdown creation
Hi, I am trying to create the dropdown control in PowerBI Custom Visual. I can create the control but the interaction is not working. Assume, the page contains multiple controls with this dropdown. if I change the selection in the dropdown, the remaining the controls should be reflected. Below the code that I have created, "use strict"; import "core-js/stable"; import "./../style/visual.less"; import powerbi from "powerbi-visuals-api"; import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions; import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions; import IVisual = powerbi.extensibility.visual.IVisual; import EnumerateVisualObjectInstancesOptions = powerbi.EnumerateVisualObjectInstancesOptions; import VisualObjectInstance = powerbi.VisualObjectInstance; import DataView = powerbi.DataView; import VisualObjectInstanceEnumerationObject = powerbi.VisualObjectInstanceEnumerationObject; import ISQExpr = powerbi.data.ISQExpr; import ISemanticFilter = powerbi.data.ISemanticFilter; import { interactivityBaseService, interactivitySelectionService } from "powerbi-visuals-utils-interactivityutils"; import appendClearCatcher = interactivityBaseService.appendClearCatcher; import createInteractivitySelectionService = interactivitySelectionService.createInteractivitySelectionService; import $ from "jquery"; import powerbiInterface from "../node_modules/powerbi-visuals-utils-interactivityutils/lib/index"; import { VisualSettings } from "./settings"; export class Visual implements IVisual { private target: HTMLElement; private settings: VisualSettings; constructor(options: VisualConstructorOptions) { console.log('Visual constructor', options); this.target = options.element; } public update(options: VisualUpdateOptions) { let dataChanged = (options.type == powerbi.VisualUpdateType.Data || options.type == powerbi.VisualUpdateType.All || $('.chart').length == 0); console.log('data changed = ' + dataChanged); if (dataChanged) { $('div, svg, select', this.target).remove(); console.log('Removed..'); } let margin = { top: 0, left: 0, bottom: 5, right: 0 }; let containerSize = { width: options.viewport.width - margin.left - margin.right, height: options.viewport.height - margin.top - margin.bottom }; console.log('container size : ' + containerSize); let $container, $comboBox; if (dataChanged) { $comboBox = $('<select class="tokenCombo"></select>').appendTo(this.target); } else { $comboBox = $('.tokenCombo'); } $comboBox.css({ 'width': containerSize.width + 'px', 'height': '45px', }); if (dataChanged) { let dataViews = options.dataViews; let dataCategorical = dataViews[0].categorical; let category = dataCategorical.categories[0]; let categories = category.values; for (let i = 0; i < categories.length; i++) { let $option = $('<option value="' + categories[i].toString() + '">' + categories[i].toString() + '</option>') .appendTo($comboBox); } } } private static parseSettings(dataView: DataView😞 VisualSettings { return <VisualSettings>VisualSettings.parse(dataView); } /** * This function gets called for each of the objects defined in the capabilities files and allows you to select which of the * objects and properties you want to expose to the users in the property pane. * */ public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions😞 VisualObjectInstance[] | VisualObjectInstanceEnumerationObject { return VisualSettings.enumerateObjectInstances(this.settings || VisualSettings.getDefault(), options); } } Also, I am trying to add the "IInteractiveBehavior" to give the interaction, but I couldn't achieve it?. Kindly help me to proceed?504Views0likes0CommentsDynamically changing the Legend in Bing map Power BI
Hi, I have created the table named "dummyperson" as shown below, Name Latitude Longitude isEligible isActive A 44.57 -73.52 Eligible Active B 44.57 -73.52 Eligible Active C 44.57 -73.52 Eligible Active D 44.57 -73.52 Eligible Active E 44.57 -73.52 InEligible Inactive F 44.57 -73.52 InEligible Inactive G 42.22 -87.99 Eligible Active H 42.22 -87.99 InEligible Active I 42.22 -87.99 InEligible Inactive Based on the table I can create the map view (isEligible & isActive) as shown below, But, Here, I need a single map. when selecting on the slicer control the map legend should be changed. the slicer table is below, I need the report as shown below, The intension of the report is based on the slicer selection, the bing map should be changed. Can you help me how to change the measure value on "Legend" property dynamically ?. Thanks, Bala.1.1KViews0likes1CommentGet the largest value of each Row in Matrix Power BI
Hi, I have created the table(Dummy) mentioned below, LeadId DateName Quarter 1 Sunday Q1 2 Sunday Q1 3 Sunday Q1 4 Sunday Q1 5 Sunday Q2 6 Sunday Q2 7 Sunday Q3 8 Monday Q1 9 Monday Q1 10 Monday Q2 11 Monday Q2 12 Monday Q2 13 Monday Q2 14 Monday Q2 15 Monday Q3 16 Monday Q3 Here, My goal is to highlight the biggest value of each row in Matrix view. So, Could you help me to create the DAX query? Thanks, Bala N.Solved823Views0likes2CommentsGet the Max vaule for every Row in Matrix Power BI
I have created the table(Dummy) mentioned below, LeadId DateName Quarter 1 Sunday Q1 2 Sunday Q1 3 Sunday Q1 4 Sunday Q1 5 Sunday Q2 6 Sunday Q2 7 Sunday Q3 8 Monday Q1 9 Monday Q1 10 Monday Q2 11 Monday Q2 12 Monday Q2 13 Monday Q2 14 Monday Q2 15 Monday Q3 16 Monday Q3 Now, I want to display the data "How many leads are there for date name and quarters?". I have created the Matrix report like the below, (The value is the count for the leadid) DateName Q1 Q2 Q3 Monday 2 5 2 Sunday 4 2 1 Now, I want to highlight Max value for every row. like below, DateName Q1 Q2 Q3 Monday 2 5 2 Sunday 4 2 1 I have tried to find the large value for each row like the below DAX, But I could not achieve it. measureMaxCount = VAR mymax = CALCULATE ( MAXX(Dummy,COUNT(Dummy[LeadId])), ALL ( Dummy[Quarter] ) ) RETURN mymax Kindly help me?Solved1.4KViews0likes4Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.