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

Dynamic Legend category in Map

Hi All,

I have a map visual having a 3 level drilldown. State --> Station -->Meter ID.
The map essentially shows malfuctioning meters.

The below is my map table structure : 

IDStateStationMeterIDLatLonDateBillingCycleMeterStatusManufacturerIsMalfunctioning
1KansasWichita SouthMT0101237.4192.452020-10-042ActiveRAYSON1

The Legend categories are '<0.1% Malfunctioning' and '>=0.1% Malfunctioning". So the Legend has to be caluclated dynamically based on drill down level and also based on the filters applied.
State,Station,Date,BillingCycle,MeterStatus,Manufacturer are user selectabe filters.


Legend Table : (Legend column would go into Legend field for the map)

LegendIDLegend
1<0.1% Malfunctioning
2>=0.1% Malfunctioning

 

I'm trying to use the disconnected table approach and the summarize statement, but I'm kind of stuck on what I should be returning after summarizing. Partial DAX measure below:

MissingreadsBucket = var Summary = SUMMARIZE(MM_LocationData,MM_LocationData[ID],"Bucket", iF(
COUNTROWS(MM_LocationData)/CALCULATE(COUNTROWS(MM_LocationData),ALL(MM_LocationData[IsMeterMissingRead])) > 0.001,">=0.1% Malfunctioning","<0.1% Malfunctioning")


Please Help . Thank You.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank You for your Answers.

 

I actually found a work around which fits my requirement. If we are willing to let go of the ability to click on the legend , We can format the icon color of the map by using the conditional formatting option shown below.

 

SVFuS.png

For the legend, We will have to make do with an image or formatted table as shown below:

AO36h.png

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank You for your Answers.

 

I actually found a work around which fits my requirement. If we are willing to let go of the ability to click on the legend , We can format the icon color of the map by using the conditional formatting option shown below.

 

SVFuS.png

For the legend, We will have to make do with an image or formatted table as shown below:

AO36h.png

 

v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept the helpful reply as the solution. More people will benefit from it.

Or you are still confused about it, please provide me with more details about the result you want, and  the measure you provide is incomplete.

Firstly, I think this measure may be added into the lenged. However, we can't add a measure into the Legend.

You may tell me the calculate logic of the "Bucket" in measure, And I can't see "IsMeterMissingRead" column in the Data model you have provided to me. 

What's more, please show me a screenshot of the Fields of you map visuals, I need to know how can you build it.

 

 

Best Regards,

Rico Zhou

 

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

MFelix
Super User
Super User

Hi @Anonymous ,

 

What is the exact purpose you need to do.

 

Using the disconnected table you should do something similar to:

MissingreadsBucket =
VAR Summary =
    SUMMARIZE (
        MM_LocationData,
        MM_LocationData[ID],
        MM_LocationData[IsMeterMissingRead]
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( LEGENDTABLE[ID] ),
        1, COUNTROWS ( FILTER ( Summary, MM_LocationData[IsMeterMissingRead] >= 0.1 ) ),
        2, COUNTROWS ( FILTER ( Summary, MM_LocationData[IsMeterMissingRead] < 0.1 ) )
    )

This is only making the count of the rows nothing more.

 

Can you please tell me what is the result you are trying to achieve.

 

If you could please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.