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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
samHwang
New Member

Adding More than One Type of Data View Mapping to Developer Visual

Using D3 and typescript, I'm trying to create a custom Power BI visual that incorporates two Cards ("Measure Card" and "Variance Indicator") and one Line Area Chart with three different series (Actuals, Target, and Forecast) for various dates. The two Cards and line area chart should be able to take in different data and not be affected by data that's entered for the other displays. However, I'm having trouble with the data view mappings in capabilities.json. The problems are two fold:
1) Intuitively, it seems as though I'd just need two different types of data view mapping: single for the cards and categorical for the line area chart. However, when I implement these changes, the visual does not update at all when data is entered into any of the data wells - Measure Card, Variance Indicator, Date, Actuals, Target, or Forecast.

2) Thus, I used a single categorical data mapping such that the Measure Card, Variance Indicator, Actuals, Target, and Forecast series are all grouped by Date. However, the problem now is that entering data into the date well affects the numbers in the Measure Card and Variance Indicator - I think this is because they are affected by the change that occurs to the dataView as date data is used to group the data. 
How can I troubleshoot this problem such that each of the displays (the two cards and line area chart) can handle data separately?

3 REPLIES 3
samHwang
New Member

Hi @v-linyulu-msft ,

Thank you for your prompt response. Could you elaborate on what you mean by "using the desired composition of the visualization as a persona? 

Is it possible to have more than one type of dataview mapping? If so, I think that if I could implement that correctly, it would solve my problem. In the screenshot below, I've shared what I'm trying to achieve: the "Measure Card" card display is in the top left corner of the screenshot (reading 118.73M), and the "Variance Indicator" card display is in the top right corner (reading 101.83M % var vs fcst). Below is the line area chart with the three separate data series (Actuals, Target, Forecast). In total, I have 6 data wells for the developer visual: Measure Card, Variance Indicator, Date, Actuals, Target, and Forecast. 

samHwang_0-1722861611398.png

Here's a screenshot of my dataRoles:

samHwang_2-1722861919488.png

 

Here's a screenshot of my current dataViewMappings:

samHwang_1-1722861871218.png

The problem I'm encountering is that so far, having everything grouped by "Date" as a categorical mapping is the only way I've gotten anything in the visual to run; otherwise, when I try to assign the Measure Card and Variance Indicator a "single" dataViewMapping, only the constructor is called upon startup but my public update method doesn't run, resulting in nothing being generated in the visual. However, the problem with grouping by date is that I think that the dataView changes when date data is entered, resulting in an incorrect summation/average/etc. for the Measure Card and Variance Indicator displays.

 

Do you know how I can troubleshoot this?

Hi, @samHwang 


Has the problem been solved? If it does, share your solution and accept it as a solution that will help other community members who have the same problem as you.

Thanks for your detailed explanation, I am more than willing to help you out.

Here's what we've found for your needs, we hope you'll find it helpful:
PowerBI-visuals/Capabilities/DataViewMappings.md at master · PowerBi-Projects/PowerBI-visuals · GitH...
 


However, the problem you are experiencing is not what we are good at.For the issue you mentioned, it would be more advisable to post your question in Custom Visuals Development community to get professional support in time.We've now moved your question to that forum.

 

Here is the link to the forum you need:
Custom Visuals Development Discussion - Microsoft Fabric Community

If you need any help from my side, I will do my best to support you.

Best Regards,

Leroy Lu

 

v-linyulu-msft
Community Support
Community Support

Hi,@samHwang 

Regarding the issue you raised, my solution is as follows:

1.You can try using the desired composition of the visualization as a persona, and then populate the data: 
 

vlinyulumsft_0-1722838492589.png

 

2.Here is a screenshot of the official documentation:
 

vlinyulumsft_1-1722838492591.png

 

Here is a link to the official documentation:

Understand data view mapping in Power BI visuals - Power BI | Microsoft Learn

Of course, if you have any new ideas, you are welcome to contact us.
 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.