自 2021 年 1 月起,经典文件类型不再可用。您可以转换经典文件或下载 PDF 文件。了解更多

Script to Pull Report into PowerBI

2

评论

3 条评论

  • Isabel Messore

    Amazing Danielle Okland, thank you for sharing this!

     

    0
  • Chris Omland

    This is great! Thank you for taking the time to share.

    0
  • Sander van Duinen

    I would like to echo the others and say: Amazing stuff Danielle! Thanks for taking the time to share :-)

    Second, I wanted to build upon Danielle's awesome work to make Workiva API's even more approachable. Specifically: the code snippet above assumes the API response is text/csv (through adding the header 'Accept = "text/csv"'). However, in a recent case of mine the response came over in JSON regardless. In these cases, the response can parsed in PowerBi as presented below. 

    response = Json.Document(Web.Contents(url, [Headers=api_headers])),
    data = response[data],

       // Convert the response to a table
    #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"responseProperty1", "responseProperty2"}, {"RenameResponseProperty1", "RenameResponseProperty2"})

    // Note that Workiva API's can return lists/records that require further expansion in PowerBi. This can be achieved through the Power Query Editor.

    in

        #"Expanded Column1"
    1

请先登录再写评论。