Forum Discussion
Dynamic Image Display
- 9 years ago
You could probably do something along the lines of create a measure like:
Lowest = CALCULATE(MIN([Severity]),ALLEXCEPT(Table,Table[Category]))
Then create another measure like:
IsLowest = IF(SUM([Severity])=[Lowest],1,0)
Then drop your IsLowest as a filter on your table visualization of the error code images.
The idea here is that Lowest calculates to the MIN taking into account the Category. The IsLowest will be filtered by the row context of the table so only the lowest will be 1.
koenverbeeck Nice solution Koen. I'm farely certain I've implemented a flavor of this in the past using the images directly tied to the data set. I don't recall if I used Dynamic Segmentation, but the result is such that depending on the values a different image could be displayed in a card or table. Your solution has a lot more flexibility with the image itself not being constrained by the PBI visual type. Very cool, thanks for sharing.
I think I am missing something here. Can't we just make a measure that returns the correct imageurl based on the condition, and then use it as a visual filter? Eg – http://sqljason.com/2016/04/hex-tile-grid-maps-for-power-bi.html (check out the portion where the images of the president change).
We can create a disconnected table in the Model (just 2 rows with ThumbsUp and ThumbsDown image url and description). Then create a measure which will return 1 for ThumbsUp if the condition is true, 1 for ThumbsDown if it’s condition is true, else 0
Test = SUMX(VALUES(Img[State]), SWITCH(Img[State], “ThumbsUp”, IF(CALCULATE(SUM(Table1[Measure]))>95,1,0), IF(CALCULATE(SUM(Table1[Measure]))>95,0,1)))
Now you can just add this measure to the visual filter of the ImageViewer and see that the image changes based on what you select. You can see the result below –
https://jasonsql.files.wordpress.com/2017/02/temp.gif
I am trying to undertsand the benefits of the R solution, and I am sure I am missing something. Is the benefit that we don't have to load the ImageURLs/images in Power BI?
- koenverbeeck9 years ago
Advocate II
Hi Jason,
(thanks for your comment on my blog btw).
I couldn't figure out how to pass the filter to the Image Viewer, so that's why I came up with the R solution.
The advantage of the R solution is indeed that you don't have to download the images. The R solution will still work when disconnected.
That being said, I do prefer your solution over mine if there is an Internet connection, as it doesn't rely on an R distribution being present.
- SqlJason9 years ago
Memorable Member
Ahhhh, now I get it. I completely forgot about the internet connectivity part :). That is a definite advantage, thanks for explaining it.
- sdurga8 years agoRegular Visitor
Can any help me in getting colured indicators....My requiremnet is
I have two columns one is Average target another one is Mean time to Repair...
Average target is a fixed column
mean time is the time to repair an incident we are getting it from service now api
Now my requirement is if my mean time is greater than avergae target it should red
if my mean time is equal to average to target it should show me yellow
if my mean time is less than average target it should show yellow.