Forum Discussion
Build custom HTML with formula
- 7 months ago
You cannot append content to a column dynamically. This must be done with a measure. Best approach is to build the HTML in a DAX measure and render it using an HTML visual.
Example measure:
Image_HTML =
VAR Img1 = IF (SELECTEDVALUE ( Items[Group1] ) = TRUE (),
"<img src='https://url1.png' style='height:30px;margin-right:5px;'/>","")
VAR Img2 = IF (
SELECTEDVALUE ( Items[Group2] ) = TRUE (),
"<img src='https://url2.png' style='height:30px;margin-right:5px;'/>","")
VAR Img3 = IF (
SELECTEDVALUE ( Items[Group3] ) = TRUE (),
"<img src='https://url3.png' style='height:30px;margin-right:5px;'/>", "")
RETURN Img1 & Img2 & Img3Use this measure in an HTML Content visual on the drillthrough page.
This works because:
Measures are evaluated per selected item
HTML can be concatenated conditionally
Only images for TRUE columns are shown
For a cleaner long-term model, unpivot the TRUE/FALSE columns and store image URLs in a lookup table
I am tracking some competitions. The competitions can be a part of one or more competition circuits. The first page lists out the competitions, and some details regarding them. The drill through page will display a more detailed list of information.
Sample data below:
| Competition | Date | Circuit 1 | Circuit 2 | Circuit 3 | Circuit 4 |
| Comp1 | 12/1/2025 | FALSE | TRUE | FALSE | FALSE |
| Comp2 | 12/15/2025 | TRUE | TRUE | FALSE | FALSE |
| Comp3 | 12/31/2025 | FALSE | TRUE | TRUE | TRUE |
| Comp4 | 1/10/2026 | FALSE | FALSE | TRUE | TRUE |
| Comp5 | 1/20/2026 | TRUE | TRUE | TRUE | TRUE |
Ideally I would like to have a new CircuitImages column that would be be populated will image urls from each of the applicable circuits. So for Comp1, it would only contain the url for Circuit 2, Comp2 would have the url for Circuit 1 and Circuit 2.