Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Using Images from a Database in Power BI - YouTube
Hello,
The above code retrieves certain columns from a table, one of which is a column containing images in binary content. The code transforms the images into text readable and understandable by Power BI and returns a table. However, when I try to execute it, I get an error that I don't understand. The Power Query editor asks me to put a parenthesis in place of the comma. I've tried, but it doesn't work. I don't understand why.
I've also attached, below the image, the link to the video from which I took the code.
Maybe the Power Query M language syntax has changed, because the video I saw is 3 years old.
Thanks in advance !
Solved! Go to Solution.
Ah, that's probably be the InputRow(xxx) parts. Try InputRow{xxx} instead since the parentheses make it think it's a function with an argument instead of an element from a list.
That particular error doesn't make sense to me. The only issue I see at first glance is that you have
CreatedDate = InputRow(InputCreateddatePosition)
instead of
CreatedDate = InputRow(InputCreatedDatePosition)
I don't get any errors with this code:
let
//Entrée des paramètres fournis pour invoquer la fonction
photoResult = (InputTable as table, InputBinaryPosition as number, InputNamePosition as number, InputCreatedDatePosition as number) as table =>
let
//Obtention des Listes d'images de la base de données
Source = (InputTable),
//Conversion de la table qui contient les images en liste
ListToInput = Table.ToRows(Source),
//Création de la fonction splitter
SplitTextFunction = Splitter.SplitTextByRepeatedLengths(30000),
//Conversion du contenu binaire en text et création d'images entrecoupées en 30000 lignes
ConvertOneFile = (InputRow as list) =>
let
Binary = InputRow(InputBinaryPosition),
Name = InputRow(InputNamePosition),
CreatedDate = InputRow(InputCreatedDatePosition),
BinaryText = Binary.ToText(Binary, BinaryEncoding.Base64),
SplitUpText = SplitTextFunction(BinaryText),
AddFileName = List.Transform(SplitUpText, each {Name, CreatedDate, _})
in
AddFileName,
//Passage en revue de toutes les photos et appel de la fonction ci-haute
ConvertsAllRows = List.Transform(ListToInput, each ConvertOneFile(_)),
//Combinaison des listes ensemble
CombineLists = List.Combine(ConvertsAllRows),
//Conversion du résultat en table
ToTable = #table(type table [Name = text, CreatedDate = date, PhotoNonConformité = text], CombineLists),
//Ajout de la colonne index à la table obtenue
AddIndexColumn = Table.AddIndexColumn(ToTable, "Index", 0, 1)
in
AddIndexColumn
in
photoResult
Thanks, it works. But when the function runs, I get the error below.
An error occurred in the "GetTheEntireImage" request. Expression.Error : Sorry... We were unable to convert a List value to a Function value.
Details:
Value=[List]
Type=[Type]
Ah, that's probably be the InputRow(xxx) parts. Try InputRow{xxx} instead since the parentheses make it think it's a function with an argument instead of an element from a list.
Thanks ! It works.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |