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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Dataviewmappings with unrelated data

I'm trying to create a custom visual similar to the shape map visual, with a few modifications. One modification is that I'm trying to find a way to use table data (strings) as the source of the json map(s). So, my data consists of:

  • A text column in a table where each item is the contents of a json file.
  • Categorical data relating to the map elements (like the current shape map visual).

I know I can't have multiple dataViews or multiple dataMappings. Does that mean the above is impossible? I've read the documentation on dataViewMappings but am having a hard time understanding what all is possible within a single dataMapping. Thanks!

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @Anonymous,

If I understand correctly, your dataViewMapping could contain the JSON data as a dataRole that would be seemingly unrelated to other data but would map out the JSON to each row of your dataView.

This can work but as you're presumably working with GeoJSON, I can't imagine these fields being particularly compact. As such having the GeoJSON in each row of your dataView is going to potentially blow up the resources your visual will need and you may not get particularly good performance. Not great if you want to use a lot of data points.

This is a great example where multiple dataViewMappings would be really useful, and I'd love to see this restriction lifted at some point...

I think that to minimise impact on visual performance and give you more flexibility with the dataView you can work with, it would probably be best to allow the GeoJSON to be provided as an object (property) of the visual, which unfortunately means that data-driving it might be tricky.

Alternatively, you could use a URL for the GeoJSON as a dataRole? This wouldn't add much overhead in terms of data consumption and you could use TypeScript to load from a known location, only if there is a difference in the value between updates?

Not sure if this answers your question, but might give you some jumping-off points.

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

4 REPLIES 4
SamuelAB
Frequent Visitor

We also require this feature to input unrelated data into the viewer.

 

In our 3D architecture viewer, we need:

  • List of elements
  • Unrelated level information to let the use control the section box cutting the building
  • Unrelated lsit of issues

Right now we need to create unnescessary fake relationship between these items, which makes for a messy data model and extra data. It's a dirty hack and we'd prefer to have an efficient method to input multiple data points that are not related in out 3D viewer application.

dm-p
Super User
Super User

Hi @Anonymous,

If I understand correctly, your dataViewMapping could contain the JSON data as a dataRole that would be seemingly unrelated to other data but would map out the JSON to each row of your dataView.

This can work but as you're presumably working with GeoJSON, I can't imagine these fields being particularly compact. As such having the GeoJSON in each row of your dataView is going to potentially blow up the resources your visual will need and you may not get particularly good performance. Not great if you want to use a lot of data points.

This is a great example where multiple dataViewMappings would be really useful, and I'd love to see this restriction lifted at some point...

I think that to minimise impact on visual performance and give you more flexibility with the dataView you can work with, it would probably be best to allow the GeoJSON to be provided as an object (property) of the visual, which unfortunately means that data-driving it might be tricky.

Alternatively, you could use a URL for the GeoJSON as a dataRole? This wouldn't add much overhead in terms of data consumption and you could use TypeScript to load from a known location, only if there is a difference in the value between updates?

Not sure if this answers your question, but might give you some jumping-off points.

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Anonymous
Not applicable

Sorry for the late reply and acceptance, but thanks for taking the time to respond! For now I have the json set up as a property of the visual, as you suggested. I agree that multiple dataViewMappings would be great to see at some point!

Hi @Anonymous - you're very welcome! Glad you have a working visual 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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