Forum Discussion

jayendra's avatar
jayendra
Frequent Visitor
9 years ago
Solved

showing false when list does not any record

while i am excuting the Power query the  list does not contain no records in Power Bi .At that time it showing the " the table is empty "i want to show false.But i am getting error.Can you please hel...
  • Anonymous's avatar
    Anonymous
    9 years ago

    jayendra,

    Add a new blank query in Power BI Desktop, then create a function in the Advanced Editor of the query with the List.IsEmpty function to check the list, when the list is empty, return false, otherwise expand the list. Below is an example for your reference.

    let
         export = (TextName as text, listname as list) =>
            let
                name = TextName,
                Table = Table.FromList(listname, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
                result= if List.IsEmpty(listname) then name else Table
    in
     result
    in
        export





    Regards,