Using Images from a Database in Power BI

  Рет қаралды 49,807

Guy in a Cube

3 жыл бұрын

We've looked at images from sources like OneDrive and the web with your Power BI reports. What about from a database? Is that possible? Patrick takes a look at how you can do it.
SQLJason Blog: sqljason.com/2018/01/embedding-images-in-power-bi-using-base64.html
Gerhard's Blog: blog.gbrueckl.at/2018/01/storing-images-powerbi-analysis-services-data-models/
Chris Webb's Blog: blog.crossjoin.co.uk/2019/05/19/storing-large-images-in-power-bi-datasets/
📢 Become a member: guyinacu.be/membership
*******************
Want to take your Power BI skills to the next level? We have training courses available to help you with your journey.
🎓 Guy in a Cube courses: guyinacu.be/courses
*******************
LET'S CONNECT!
*******************
-- guyinacube
-- awsaxton
-- patrickdba
-- guyinacube
-- guyinacube
-- guyinacube.com
***Gear***
🛠 Check out my Tools page - guyinacube.com/tools/
#PowerBI #Images #GuyInACube

Пікірлер: 50
@strongemotion
@strongemotion 10 ай бұрын
This is one of the most important blog posts I've found for Power BI. We EXTENSIVELY use images stored in our SQL database. So many of the other applications we use (VB, C#, JavaScript, CrystalReports) all have native or nearly-native support for images in the database. Your blog post will hopefully make my life easier.
@ChrisWilliams808
@ChrisWilliams808 3 жыл бұрын
I'll be adding a link to this video on our website, because it's an important design approach and this is a great teaching presentation. Our company makes a variety of both certified and uncertified custom visuals, and because of Microsoft security policy, certified visuals are not allowed to make external or remote calls to resources like image urls. So if customers want to use certified visuals, images have to come from the database, and this is a good resource to show how.
@AliImran-rf4lo
@AliImran-rf4lo 3 жыл бұрын
Thank you, Patrick. I needed this desperately. I may be missing something but in my case, it only works when relation is created between my main table and table crated by function.
@eagillum
@eagillum Жыл бұрын
1:16- Converting from Binary to Text via concatenating to Base 64 code (but it only gives you half an image if your character limit is over 32,667) 4:12- Getting the whole image (splitting the characters into rows)
@TanjilulA
@TanjilulA 2 жыл бұрын
For anyone attempting this, here is the code of the function: //Start of code let //Get list of files in folder picresult = (InputTable as table, InputBinaryZBPosition as number, InputKeyNameZBPosition as number) as table => let //Get list of images from Database Source = (InputTable), //Converts table that contains images to list ListToInput = Table.ToRows(Source), //Creates Splitter function SplitTextFunction = Splitter.SplitTextByRepeatedLengths(30000), //THE MAGIC!!!! Converts BINARY TO TEXT and creates and splits image into 30K rows ConvertOneFile = (InputRow as list) => let BinaryIn = InputRow{InputBinaryZBPosition}, RegionName = InputRow{InputKeyNameZBPosition}, //CountryKey = InputRow{InputKeyZBPosition}, BinaryText = Binary.ToText(BinaryIn, BinaryEncoding.Base64), SplitUpText = SplitTextFunction(BinaryText), //AddFileName = List.Transform(SplitUpText, each {RegionName,CountryKey,_}) AddFileName = List.Transform(SplitUpText, each {RegionName,_}) in AddFileName, //Loops over all photos and calls the above function ConvertAllFiles = List.Transform(ListToInput, each ConvertOneFile(_)), //Combines lists together CombineLists = List.Combine(ConvertAllFiles), //Converts results to table ToTable = #table(type table[Name=text,Pic=text],CombineLists), //Adds index column to output table AddIndexColumn = Table.AddIndexColumn(ToTable, "Index", 0, 1) in AddIndexColumn in picresult //End of Code
@SpaceDino6928
@SpaceDino6928 2 жыл бұрын
Thanks for this! This comment should be pinned!
@afonso0078
@afonso0078 Жыл бұрын
I appreciate your attitude, thank you very much. :)
@strongemotion
@strongemotion 10 ай бұрын
LOL, I just re-typed it from scratch.
@MikeHogg-u8j
@MikeHogg-u8j 6 ай бұрын
@@strongemotion Good thing you did, bro missed an input in their code
@huqsami
@huqsami 3 жыл бұрын
Great! Btw, Any idea how to import images from local folder? Excel power view seems to do it quite easily so why can’t powerbi?
@subanark
@subanark 3 жыл бұрын
Nifty, super powerful, but maybe we could get an easier way of doing this in the future? Just a note for people: If your importing SVGs, don't base64 encode them, it won't work. They work fine as plain SVGs.
@AndrewMcDonald123
@AndrewMcDonald123 2 жыл бұрын
Just what I needed, Thank you Patrick!
@MikeHogg-u8j
@MikeHogg-u8j 6 ай бұрын
I got it working! What a mission. Seems simple after you figure it out! Also damn datatypes confused the shit out of me at first. Good luck everyone!
@Funcion_de_seguridad
@Funcion_de_seguridad 3 жыл бұрын
Thank you Patrick! good explanation. Regards from Peru
@narasimhapandit5148
@narasimhapandit5148 2 ай бұрын
@guyinacube Hi @patrick I am only able to do this for image with smaller size when the size of the image changes it gives error saying maximum allowable length exceeded.
@abubakaragtamin9676
@abubakaragtamin9676 3 жыл бұрын
That was impressive Patrick!! This is what I am looking for. Thanks bro
@mitchellcauthron361
@mitchellcauthron361 3 жыл бұрын
I get no partial or full image when creating DB Image column and setting Data category to Image URL. I am trying to look at pdf documents, not jpeg so swapted the "image/jpeg" to "image/pdf" but still get no image. Any suggestions?
@DrMk64
@DrMk64 2 жыл бұрын
Hi Patrick/Mitchell, I'm getting the same problem trying to view pdfs. Any ideas?
@z.hpungaungli6913
@z.hpungaungli6913 3 жыл бұрын
Thanks a lot for your presentation and for sharing that I've been searching for a long time. 😇
@halliegromek1838
@halliegromek1838 2 жыл бұрын
Hi Patrick! This is exactly what I am looking for, do you have the getTheEntireImage code posted anywhere?
@sharmacreatives255
@sharmacreatives255 Жыл бұрын
Could we add music to any page...so that while accessing or viewing could be with some professional background music
@faridfarid7070
@faridfarid7070 Жыл бұрын
this is if the stored data is the URL to the Image ! what if we have a the image data stored in the DB ?? is there any possibility to show on power bi ??
@barryA669
@barryA669 7 ай бұрын
How can i show the pictures in large scale and not in thumbling size? i need to display one large picture on a page
@karir7946
@karir7946 3 жыл бұрын
Great presentation. What software are you using to create?
@sharmacreatives255
@sharmacreatives255 Жыл бұрын
Could we have animated background in mobile layout in power bi...and when viewed in mobile could the animated background work...pls let me know sir
@vikashmishra8528
@vikashmishra8528 2 жыл бұрын
It works for JPEG file but not with BMP file any suggestion.
@MJ-cw3ox
@MJ-cw3ox 2 жыл бұрын
Hello Patrick, thanks for sharing the tech. One question, where can we get the function getTheEntireImage code ? Thanks.
@MJ-cw3ox
@MJ-cw3ox 2 жыл бұрын
I got it now. Extracted from Image :) =-=-=-===============-========= getTheEntireImage function =-=-=========================== let //Input parameters provided to invoke function picresult = (InputTable as table, InputBinaryZBPosition as number, InputkeyZBPosition as number) as table => let // Get list of images from Database Source = (InputTable), // Converts table that contains images to list ListToInput = Table.ToRows(Source), //Creates splitter function SplitTextFunction = Splitter.SplitTextByRepeatedLengths(30000), //THE MAGIC!!!! Converts Binary to text and creates and splits image into 30K rows ConvertOneFile = (InputRow as list) => let BinaryIn = InputRow{InputBinaryZBPosition}, // RegionName = InputRow{InputKeyNameZBPosition}, Countrykey = InputRow{InputkeyZBPosition}, BinaryText = Binary.ToText(BinaryIn, BinaryEncoding.Base64), SplitUpText = SplitTextFunction(BinaryText), AddFileName = List.Transform(SplitUpText, each {Countrykey,_}) in AddFileName, // Loops over all photos and calls the above function ConvertsAllRows = List.Transform(ListToInput, each ConvertOneFile(_)), ///Combines lists together CombineLists = List.Combine (ConvertsAllRows), //Converts results to table ToTable = #table(type table[CountryKey = number, Pic=text], CombineLists), //Adds index column to output table AddIndexColumn = Table.AddIndexColumn(ToTable, "Index", 0, 1) in AddIndexColumn in picresult
@halliegromek1838
@halliegromek1838 2 жыл бұрын
hi, did you find out where this is?
@wasio44
@wasio44 3 жыл бұрын
Hi Patrick, many thanks for that video! I wanted to know : is it possible to have a clickable image ? in my dataset, i have column for image URL, and also for website URL. by playing with slices, i want to show an image and be able to directly click on it to go the website. Any idea? for the moment i've set a table with an image and the link icon close to it, but it is not really instinctive for the final users . thanks!!
@michellejrgensen2897
@michellejrgensen2897 3 жыл бұрын
I am Getting an error that #table is invalid constant value what is the realtion to this #table ?? it the #tabel a parameter
@JorgeOrtizG
@JorgeOrtizG 3 жыл бұрын
Great video as always. What happen when I have just one image (company logo for example) and I don't need or want to use a table to display it?
@ChrisWilliams808
@ChrisWilliams808 3 жыл бұрын
You can try something like Image by CloudScope (search AppSource). My company makes it, full disclosure.
@GIO200011
@GIO200011 3 жыл бұрын
You can just import the image from the insert menu.
@nathanphillips3628
@nathanphillips3628 3 жыл бұрын
Depending on the use case, an image can be downscaled and base64 encoded as a varchar in the DB. Let's say you had 10 client logos to be controlled using RLS, and you wanted them to display in the top right of a page. They don't need to be massive, and can fit within that character limit. If pulled in as base64 from the DB, then one only needs to change the data type to image url. Boom! Done! If the images must be large, this of course will not work. Not as scalable as the solution unpacked here, but simpler maybe.
@loraynne18071
@loraynne18071 Жыл бұрын
In Power BI Report Builder?
@AutodafeSynths
@AutodafeSynths 2 жыл бұрын
great solution!!!
@mrkakashi_1129
@mrkakashi_1129 2 жыл бұрын
let //Get list of files in folder Source = (InputTable as table, inputbinaryzbposition as number, inputkeynamezbposition as number, inputkeyzbposition as number) as table => let Source = (InputTable), ListToInput = Table.ToRows(Source), //Creates Splitter function SplitTextFunction = Splitter.SplitTextByRepeatedLengths(30000), //Converts table of files to list //Function to convert binary of photo to multiple //text values ConvertOneFile = (InputRow as list) => let BinaryIn = InputRow{inputbinaryzbposition}, ProfileName = InputRow{inputkeynamezbposition}, CountryKey = InputRow{inputkeyzbposition}, BinaryText = Binary.ToText(BinaryIn, BinaryEncoding.Base64), SplitUpText = SplitTextFunction(BinaryText), AddFileName = List.Transform(SplitUpText, each {ProfileName,_}) in AddFileName, //Loops over all photos and calls the above function ConvertAllRows = List.Transform(ListToInput, each ConvertOneFile(_)), //Combines lists together CombineLists = List.Combine(ConvertAllRows), //Converts results to table ToTable = #table(type table[ProfileName=text, CountryKey = number],CombineLists), //Adds index column to output table AddIndexColumn = Table.AddIndexColumn(ToTable, "Index", 0, 1) in AddIndexColumn in Source
@penchalapratappalukuri7070
@penchalapratappalukuri7070 3 жыл бұрын
Hi Guys,can anybody tell me ,how to create a custom button,when user clicks this button it will export the report to excel.Thanks in advance.
@sdeekshita3344
@sdeekshita3344 2 жыл бұрын
Hi, Did you find the solution, I have similar requirement but should export to PDF.
@holahandstrom
@holahandstrom 3 жыл бұрын
Good, but frankly - it should be much easier to Store and Display Images, for the average user.
@shofyansky
@shofyansky 3 жыл бұрын
Great video dude
@Babayagaom
@Babayagaom 3 жыл бұрын
I have similar requirement in paginated reports
@solidoffortitude
@solidoffortitude 3 жыл бұрын
Yeah. It's a fun solution, but I gave up on this functionality because it puts unnecessary strain on the platform. Just like I can use awesome animated GIFs on buttons, but they blow up my PBIX exponentially.
@sdeekshita3344
@sdeekshita3344 2 жыл бұрын
What alternative did you use
@notoriousft
@notoriousft 3 жыл бұрын
Interesting, such a basic functionality requires this amount of tinkering.
@djokotriono7787
@djokotriono7787 3 жыл бұрын
makes me think ms doesn't exactly want people to use pbi
@junaidmalik9593
@junaidmalik9593 3 жыл бұрын
Great video , but too much for me to digest 😛
Зу-зу Күлпаш 2. Бригадир.
43:03
ASTANATV Movie
Рет қаралды 733 М.
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
路飞与唐舞桐
Рет қаралды 29 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 10 МЛН
iPhone 7
0:13
ARGEN
Рет қаралды 18 МЛН
How to connect electrical wires with good contact #short
0:29
Tuan CT
Рет қаралды 23 МЛН
Wireless switch part 177
0:58
DailyTech
Рет қаралды 12 МЛН
#ipl #iphone #россия #aquarium
0:12
ТУНИКАФОН - TUNIKAFON
Рет қаралды 2,4 МЛН