powerquery

How to search multiple strings in a string?

杀马特。学长 韩版系。学妹 提交于 2019-12-22 05:04:45
问题 I want to check in a powerquery new column if a string like "This is a test string" contains any of the strings list items {"dog","string","bark"} . I already tried Text.PositionOfAny("This is a test string",{"dog","string","bark"}) , but the function only accepts single-character values Expression.Error: The value isn't a single-character string. Any solution for this? 回答1: This is a case where you'll want to combine a few M library functions together. You'll want to use Text.Contains many

authenticating with Excel Power Query against .Net Odata Web Api

◇◆丶佛笑我妖孽 提交于 2019-12-21 20:25:46
问题 I am trying to use Power Query to download an Odata Feed that I created using .net Web Api 2 and the OData v4 nuget package. I'm trying to access an Odata feed that requires authentication. When I edit the authentication type in power query, I'm never seeing the authentication key come through in the request. How do you configure Power Query to use a specific type of authentication? Bonus: I'm using OAuth, so how would I configure power query to send in a header with auth data that includes

How to get paginated data from API in Power BI

北战南征 提交于 2019-12-21 05:41:15
问题 Let's say we have this endpoint https://reqres.in/api/users . The response is { "page": 1, "per_page": 3, "total": 12, "total_pages": 4, "data": [ { "id": 1, "first_name": "George", "last_name": "Bluth", "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/calebogden/128.jpg" }, { "id": 2, "first_name": "Janet", "last_name": "Weaver", "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/josephstein/128.jpg" }, { "id": 3, "first_name": "Emma", "last_name": "Wong", "avatar": "https:/

How to make bar chart order values in DESC order after you choose value on another chart

天大地大妈咪最大 提交于 2019-12-20 04:58:33
问题 I have a Treemap chart that represents locations and bar charts that represents agents. When I click on one of the location I want agents be filtered in DESC order by money value. For example, I clicked on Modesto location and bar chart highlights particular people that are not in order. Any way not to display NOT highlighted values at all or bring them all the way on a bottom? I know that I can use the slicer with locations for that, but I want Treemap act as a filter in this situation. Is

Add column of previous values from table of tables in Power BI / Power Query

和自甴很熟 提交于 2019-12-20 04:34:12
问题 Looking for a followup to Max Zelensky's solution here. Assuming the original example had a [Date] field, I'm trying to go one more level and add a column that shows the prior [Date] value I've also looked here and here and here. Per Max, I've created the table of tables: AddedCustom = Table.AddColumn(GroupedRows, "Custom", each Table.AddIndexColumn([tmp],"Occurrence", 1,1) type table) Created a second index: SecondIndex= Table.AddColumn(AddedCustom, "Custom.2", each Table.AddIndexColumn(

Excel PowerQuery: How to unpivot or transpose a huge table into a readable format for analysis

Deadly 提交于 2019-12-19 11:53:56
问题 I have this table that looks similar to this: And I want to transform it so that it looks like this: The idea is to unpivot( or transpose) the table so that it can be feed into other BI tools, and be readable for analysis. I have around 20 tables like this with 100+ cols, so of course to do it manually is nearly impossible. How do I get this done with PowerQuery? I have tried using unpivot feature, but I am stuck as it displayed NYC1, NYC2, etc. VBA, macros don't work also. Any other

How can I turn the deepest elements of nested JSON payload into individual rows in Power Query?

拈花ヽ惹草 提交于 2019-12-19 04:02:02
问题 Goal : I have a JSON payload with the following format: { "Values": [ { "Details": { "14342": { "2016-06-07T00:00:00": { "Value": 99.62, "Count": 7186 }, "2016-06-08T00:00:00": { "Value": 99.73, "Count": 7492 } }, "14362": { "2016-06-07T00:00:00": { "Value": 97.55, "Count": 1879 }, "2016-06-08T00:00:00": { "Value": 92.68, "Count": 355 } } }, "Key": "query5570027", "Total": 0.0 }, { "Details": { "14342": { "2016-06-07T00:00:00": { "Value": 0.0, "Count": 1018 }, "2016-06-08T00:00:00": { "Value"

Json to excel using power query

♀尐吖头ヾ 提交于 2019-12-18 11:47:28
问题 I have some json on a website that i want to convert to excel using the power query option from web . But I ran into a small problem. My json looks like this: [ { "id" : 1, "visitors" : 26, "some_number" : 1, "value" : 3500 }, { "id" : 2, "visitors" : 21, "some_number" : 5, "value" : 2000 } ] but when i use from web i get this: I can drill down into a record,convert it to a table, transpose and use first row as header but then i get just one row. How can i get all of my data to the table and

How to check whether Connection Refresh was successful

Deadly 提交于 2019-12-17 16:42:12
问题 In Excel 2016 VBA, I'm refreshing several queries like this: MyWorkbook.Connections(MyConnectionName).Refresh After the code is done, and no errors are encountered, I see that the hourglass icons for most of the queries are still spinning for several seconds. Is it possible to check for success AFTER all the refreshes are completed? I'm concerned that my code isn't going to know if an error happens after the code finishes but before the queries are done refreshing. BTW I don't want to do a

Excel Power Query: get data from multiple unfixed files with multiple unfixed sheets

拜拜、爱过 提交于 2019-12-14 03:28:11
问题 There are unfixed number of excel files in folder as per image1. ( Path may change, looking for solution as dynamic path from any cell) There are unfixed number of sheets ( Max 10 sheets) in each file. Each sheet have approx 10 to 40 top rows as transaction data. After transaction data there are two summaries- Qty and Amount ( unfixed starting row) 3a,3b,3c I am looking for final output as image 4a, 4b. using power query. Folder path of excel file; it may change. Sample data sheets on file