The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Having a brain fart. I've got hundreds of images I can bring into my Power BI reports via Sharepoint, and Bas has a good youtube video for how to do this, but only in a measure where he uses the Switch function. (He says this can also work in a column, but it didn't work for me, so I'm going back to a measure.)
He uses the SWITCH function:
Image Product Category =
SWITCH(
MAX(dimProduct[ProductCategoryName]),
"Audio", "Image1",
"Computers", "Image2",
"Cell Phones", "Image3"
)
...but I don't want to list every single instance and then its URL. I'm using loan numbers and pictures of their collateral. I just want to say "when you see this loan number, post its respective image." What is the syntax for that?
Thanks.
Solved! Go to Solution.
Hi @bonjourposte -You're on the right track with using the SWITCH function, but as you've noticed, manually listing every image URL for each loan number can get cumbersome, especially with hundreds of images. Instead, you can simplify this by creating a relationship between your loan numbers and their respective image URLs in a table, and then use a measure to dynamically return the image URL based on the loan number.
You can create a measure using CONCATENATE (or &) to build the full image URL dynamically from the loan number:
LoanImageURL =
VAR LoanNumber = MAX(LoanData[LoanNumber]) -- Get the current loan number
RETURN
"https://yoursharepointsite/images/" & LoanNumber & ".jpg" -- Construct the URL dynamically
You don’t need to create a separate table with loan numbers and URLs. Hope this works in your case.
Proud to be a Super User! | |
Hi @bonjourposte -You're on the right track with using the SWITCH function, but as you've noticed, manually listing every image URL for each loan number can get cumbersome, especially with hundreds of images. Instead, you can simplify this by creating a relationship between your loan numbers and their respective image URLs in a table, and then use a measure to dynamically return the image URL based on the loan number.
You can create a measure using CONCATENATE (or &) to build the full image URL dynamically from the loan number:
LoanImageURL =
VAR LoanNumber = MAX(LoanData[LoanNumber]) -- Get the current loan number
RETURN
"https://yoursharepointsite/images/" & LoanNumber & ".jpg" -- Construct the URL dynamically
You don’t need to create a separate table with loan numbers and URLs. Hope this works in your case.
Proud to be a Super User! | |
User | Count |
---|---|
69 | |
69 | |
66 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
66 | |
48 | |
43 |