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
Anonymous
Not applicable

Dynamic Categorization of a Measure

Hi All,
I have a matrix visual which shows Installation Progress at two levels , at a state level and and on expanding ,at a city level.


When at state level, The value should be shown as an image to indicate the status. When expanded to City level, it should show the actual installation count.

I have managed to write a measure for the same :

Installs = var a = SUM('Summary_Matrix'[Installs])
var b = IF(ISBLANK(a),0,a)
var c= if(b >= 10000,3,if(b < 5000,1,2))
return IF(HASONEFILTER('City_Master'[City]),b,"https://sample.blob.core.windows.net/powerbi-images/" & c & ".PNG")

 

1.PNG,2.PNG and 3.PNG being the images in the blob.

I'm getting the desired output for the measure, But not able to categorize the measure as Image Url since it will return a number is some cases. Now The link is shown as text in the matrix. Is there anyway for it to categorize the measure based on the return value type.

Thanks in Advance.

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

To my knowledge this is not possible. A measure can only have a single data category, if you format the numbers to text you will be able to use the Image URL data category but that will also break the numeric values as the application will try to import all values as images. 

There might be custom visuals that can allow this but I'm honestly not sure. 

I would recommend layering two visuals ontop of eachother, one holding the images and another holding the numeric values. This should allow you to accomplish the same layout you're after.

Br,
J


Connect on LinkedIn

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks All for your response. As mentioned by everyone, the requirement specified in the original query is not possible.

However for anyone interested in a workaround ,I was able to achieve this using the conditional formatting using icons feature and only applying it to the Totals and selecting layout as icon only.

 

DeploymentStatus_V2.png

 

 

v-lili6-msft
Community Support
Community Support

hi @Anonymous 

To my knowledge, it could not achieve in power bi for now, since measure is a dynamic summary value by current row context, it could not define a category for it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tex628
Community Champion
Community Champion

To my knowledge this is not possible. A measure can only have a single data category, if you format the numbers to text you will be able to use the Image URL data category but that will also break the numeric values as the application will try to import all values as images. 

There might be custom visuals that can allow this but I'm honestly not sure. 

I would recommend layering two visuals ontop of eachother, one holding the images and another holding the numeric values. This should allow you to accomplish the same layout you're after.

Br,
J


Connect on LinkedIn

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.

Top Solution Authors