powerquery

Reference a column by a variable

吃可爱长大的小学妹 提交于 2021-01-27 18:31:10
问题 I want to reference a table column by a variable while creating another column but I can't get the syntax: t0 = Table.FromRecords({[a = 1, b = 2]}), c0 = "a", c1 = "b", t1 = Table.AddColumn(t0, "c", each([c0] + [c1])) I get the error the record's field 'c0' was not found . It is understanding c0 as a literal but I want the text value contained in c0 . How to do it? Edit I used this inspired by the accepted answer: t0 = Table.FromRecords({[a = 1, b = 2]}), c0 = "a", c1 = "b", t1 = Table

Power Query: pass column name as function parameter

江枫思渺然 提交于 2021-01-07 04:16:28
问题 I'm struggling to pass column names to a power query function - if I pass them as [columnname] within the function call, it tries to implement them outside the function; if I pass using [parameter] within the function itself, it looks for a column "parameter" and not the column name that's passed in the call. Elsewhere, StackExchange recommends using Table.Column(table,columnname) to get around this, but the I get the whole column in one go, rather than being able to compare corresponding

Power BI: how to merge specific tables

空扰寡人 提交于 2021-01-01 14:34:51
问题 I have Table A with data of specific people doing their tasks like this: I have Table B with data of needs for specific people for different periods of time like this: I also have additional table C with period definitions: Period no | Date from | Date to -------------------------------------- 1 | 27/01/2021 | 24/02/2021 2 | 25/02/2021 | 24/03/2021 ... There are 2 problems here: Someone in Table A can have Start and End dates spanning multiple periods, like for example Human B The Start and

Power BI: how to merge specific tables

主宰稳场 提交于 2021-01-01 14:33:45
问题 I have Table A with data of specific people doing their tasks like this: I have Table B with data of needs for specific people for different periods of time like this: I also have additional table C with period definitions: Period no | Date from | Date to -------------------------------------- 1 | 27/01/2021 | 24/02/2021 2 | 25/02/2021 | 24/03/2021 ... There are 2 problems here: Someone in Table A can have Start and End dates spanning multiple periods, like for example Human B The Start and

Power BI: how to merge specific tables

。_饼干妹妹 提交于 2021-01-01 14:33:11
问题 I have Table A with data of specific people doing their tasks like this: I have Table B with data of needs for specific people for different periods of time like this: I also have additional table C with period definitions: Period no | Date from | Date to -------------------------------------- 1 | 27/01/2021 | 24/02/2021 2 | 25/02/2021 | 24/03/2021 ... There are 2 problems here: Someone in Table A can have Start and End dates spanning multiple periods, like for example Human B The Start and

How to allow other users to run power query (which generates data from SQL Server) in Excel 2016

倾然丶 夕夏残阳落幕 提交于 2020-12-27 05:28:56
问题 We have created an excel in which shows data generated from SQL Server using power query, and want to share it with other users. The excel refreshes all tables using VBA's ThisWorkBook.Connections.("QuerName").Refresh to run all queries. The Problem is that: When we share this excel to co-workers from other departments, the excel requires new users to enter UserName and Password for SQL database instead of use the Username and Password we entered during creating this excel. We found that

How to allow other users to run power query (which generates data from SQL Server) in Excel 2016

雨燕双飞 提交于 2020-12-27 05:28:55
问题 We have created an excel in which shows data generated from SQL Server using power query, and want to share it with other users. The excel refreshes all tables using VBA's ThisWorkBook.Connections.("QuerName").Refresh to run all queries. The Problem is that: When we share this excel to co-workers from other departments, the excel requires new users to enter UserName and Password for SQL database instead of use the Username and Password we entered during creating this excel. We found that

How to show data properly in Office Excel Using Power Query Editor?

戏子无情 提交于 2020-12-26 06:56:22
问题 I have below JSON output from an API, in Office Excel I am importing data via Web from API. [{ "level": 1, "children": [{ "level": 2, "children": [{ "level": 3, "name": "Chandni Chowk", "data": ["Data 1", "Data 2"] }], "name": "Delhi", "data": ["Delhi Area"] }], "name": "Country", "data": ["India", "Bangladesh"] }] https://docs.microsoft.com/en-us/powerquery-m/quick-tour-of-the-power-query-m-formula-language I have above document. let Source = Json.Document(Web.Contents("MY API URL GOES HERE"

Move up values when null Power Query

浪子不回头ぞ 提交于 2020-12-15 08:11:29
问题 At this moment I have a big table in Excel that I would like to use with dynamic dropdown (cascade options). Depending on the selection you do on the first dropdown, then in the next cell, you should have a filtered drop down menu. Also, any option is unique for the main category selected. The first thing I did was to take the columns I need and pivot them so it looks something similar to this (C are the column names and V are the values. Since any option is unique for any category, I have

Move up values when null Power Query

强颜欢笑 提交于 2020-12-15 07:58:01
问题 At this moment I have a big table in Excel that I would like to use with dynamic dropdown (cascade options). Depending on the selection you do on the first dropdown, then in the next cell, you should have a filtered drop down menu. Also, any option is unique for the main category selected. The first thing I did was to take the columns I need and pivot them so it looks something similar to this (C are the column names and V are the values. Since any option is unique for any category, I have