Forum Discussion

ck18's avatar
ck18
Frequent Visitor
7 years ago
Solved

Assistance with SQL Parameters in Power BI - Help with creating a list from SQL Query

Sorry, repeating as my first question was marked as spam. I removed the link which I assume is why my post was removed.   I have been trying to follow this link to create a list in Power BI. For a ...
  • ImkeF's avatar
    7 years ago

    Not sure how your data exactly looks like, but you can try this one as a start:

     

    let
        Source = Sql.Database("localhost", "AdventureWorks2014"),
        Production_ProductCategory = Source{[Schema="Production",Item="ProductCategory"]}[Data],
        #"Added Custom" = Table.AddColumn(Production_ProductCategory, "ProductCategoryID", each [Name]),
        CategoriesList = #"Added Custom"[ProductCategoryID],
        #"RemovedDuplicates" = List.Distinct(CategoriesList)
    in
        #"RemovedDuplicates"