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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dp24
New Member

Method to use measure as legend?

Hi all,

 

Happy to share a workbook if necessary, after masking my data, but I think the question probably applies generally.

 

In short, I have a table with a list of items each with a start and end date, and I want to compare them against a date provided from a slicer on the report, and use a formula to assign a status based on the date comparison (‘not started’, ‘in progress’, ‘complete’). I have a separate table with dates which feeds a slicer, and a measure (using SELECTEDVALUE) reading the chosen date.

 

I’ve created a SWITCH measure which compares the SELECTEDVALUE measure against the start or end date of each item. This works fine in a table, and shows the correct status based upon the selected date.

 

However, I want to use this as a legend (specifically on a map, in this case) which is obviously a problem as ‘Legend’ will only allow a column reference.

 

Does anyone have a potential workaround which would effectively allow the measure result to be converted to a column and therefore enable it to be used as a legend?

 

Thanks in advance!

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @dp24 ,

Nope, I don't think it is possible. Current power bi not allow you to use measure on axis and legend fields, you can consider to submit/vote idea for this requirement.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks @v-shex-msft

 

I appreciate the limitation of not being able to use the measure directly as a legend, really just wondering if anyone has a clever workaround in DAX before I have to come up with a solution in the source data (which could be a problem due to the size of the dataset)

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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