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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
amitchandak
Super User
Super User

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors