Im trying to access a web location through power query/power bi. I have a url and the first time I put it in it asked me the access method, ie windows account or organization account. Unfortunately I put in the wrong method and it is denying me access. Now when I try again with the same url it does not ask me the access method it just goes straight to access denied. How do I get it to ask that question again so I can change the method. Is there some sort of cache that needs to be cleared?
Data access issue
Applied Steps and Re-quering Data Source
Using Power Query, each time you change a field type or expand a column does the step result in the data source being re-queried?
Steps:
connect to a data source
filter rows
change column type
expand column
Would the steps outlined above result in one query back to the data source or multiple?
Extracting data from Time Log extension in Azure DevOps.
I am using the Time Log extension to capture times within stories and tasks in Azure DevOps.
I am extracting the ADO information into power BI. I am manually dumping the Time Log information from the Time Log Summary into a csv, store it in sharepoint and then it will load into power bi.
Being "constructively lazy", i would like to know if it is possible (and how) to load into power bi from the azure extension area directly os that it will update during the scheduled refreshes.
The link when i look through chrome seems to come back immediately with all the data. I cant figure out how to bring that query into my power query to get the same data (just beggining the journey into the wonders of Power BI).
Reduce table in table to columns
I use Power Query for Microsoft Excel. I get my data from an API. I transform it and group it. Afterwards, I receive a table which has table entries. I don't need tables there, I need the first column of the table in the table.
The first column of the column is only the name of the column, so I need to remove the first column.
I tried to use the "Extend columns" functionality (symbol with the two arrows in the header). But then I get the two columns in the first column. Doing the same in the second column, brings up lines of the first column multiplied with number of lines of the second columns.
I just want to see the columns in a table withe original number of results.
How can I achieve this?
Expand the column
My code after the API request. This request is not provided.
DAX formula for MTA
Hi there, I have a Sharepoint list (Infopath form) in which you can insert milestones, their start date, their planned end date and their new end date (if its different from the planned end date). After all I want to create an MTA with this data. So what I want power query actually to do is, set the data of the new end date column to a new "report-column". Like when it is 1. October 2020 I want the data of the new end date column set to the column "01.10.2020" and so on. Is this possible? Thank you very much!! Jasmin
Salesforce Object Connector - Nested query
Hi.
I have a problem receiving the data that I want from the object connector. Through the Salesforce database our developer is able to query the data using a "nested query":
In Power BI I have enabled "Include relationship columns" when I load ClassMembership__Feed to get the column; however, when I try to expand FeedTrackedChanges I get:
The M-code looks like this (on a text-expand)
How can I replicate the resonse that the developer is getting from Salesforce direct query?
If it's monday then display last friday date
Hello, I'm trying to create a query where if it's a monday then set the date to the last friday else previous day. So for example for this week monday was the 14th so I would like Todaycode to show 20200911 instead of 20200913 since it usually just takes the previous day.
I've tried to use If Date.Dayofweek(#"Inserted Merged Column", Column1 = 1) then [custom.1] -3 else #"Inserted Merged Column"{0}[Todaycode] without success.
I would apreciate the help to solve this, thanks in advance!
Data from API
Hi everyone.
I'm having big problems retreving some data from an restfull api.
APi documentation example looks like this.
Product
Usage
This endpoints allows retrieveal, creation, modification and deletion of products in Warehouze, it also allows retrieval of stock quantities pr. warehouse.
Get
Call requires at least one property name, blank query is allowed.
AdjustedInStockQty | Decimal | False | |
Barcode | String | True | |
Barred | Boolean | True | |
BaseNumber | String | False | |
ColliQty | Decimal | False | |
CompanyId | Int32 | False | |
CreationDate | DateTime | False | |
CustomProductPropertyFive | String | False | |
CustomProductPropertyFour | String | False | |
CustomProductPropertyOne | String | False | |
CustomProductPropertyThree | String | False | |
CustomProductPropertyTwo | String | False | |
DataSource | DataSource | 0 Economic, 1 SmartWeb, 2 Local, 3 Magento, 4 GoldenPlanet, 5 Shopify, 6 WooCommerce, 7 FakturaFil, 8 IEX | False |
DeliveryDays | Int32 | True | |
ExtraCosts | Decimal | False | |
GroupId | Int32 | False | |
Height | Decimal | False | |
Id | Int32 | False | |
IncludeInShoppinglist | Boolean | False | |
IsCollectionMaster | Boolean | False | |
IsMaster | Boolean | False | |
LastUpdated | DateTime | False | |
Length | Decimal | False | |
LocationId | Int32 | False | |
Name | String | True | |
Notes | String | True | |
Notifications | String | False | |
Number | String | False | |
OrderedByCustomersQty | Decimal | False | |
OrderedFromSuppliersQty | Decimal | False | |
PoQtyMin | Decimal | False | |
SelectedVariantType1 | String | False | |
SelectedVariantType2 | String | False | |
ShippingMethod | String | False | |
ShippingPrice | Decimal | False | |
ShoppingQty | Decimal | False | |
StockQty | Decimal | False | |
SupplierId | Int32 | True | |
SupplierProductNumber | String | True | |
TurnoverQty | Decimal | False | |
UnitCostPrice | Decimal | False | |
UnitId | Int32 | False | |
UnitPrice | Decimal | False | |
UnitSalesPrice | Decimal | False | |
VariantMasterId | Int32 | False | |
Volume | Decimal | False | |
WarehouseId | Int32 | False | |
Weight | Decimal | False | |
Width | Decimal | False |
var request = { Token:"Insert your token here", Query: [ "Number=130", "WarehouseNumber=1", ], Properties: [ "Id", "Name", "StockQty", ], }; $.ajax({ url:"https://api.warehouze.io/Product", data: request, dataType:'text', type:"GET", traditional:true, success:function (data) { console.log(data); }, error:function (data, xHr) { console.log(data); console.log(xHr); } });
Can anyone help me how to extract data?
custom function changes datatype during run time
In power query I got a custom function which picks up the data, does left join and returns the records properly. The tables are linked using t1.c1 and t2.c2. the data type of both columns is Text. It is tested using sample data file used for the function. When that custom function is called from some else place (i read all files from a folder and call the function for each of the file)...the function works correctly except for the data with last digit as zero. e.g. "01.10", "01.20" in this last value is zero wherein for t1 the value is automatically converted as "01.1" and in T2 the value is retained as "01.01". Bu then records doesn't get linked as the data alues are different. Please note, in both the tables field's data type is text, but it seems still it trims out zero from t1.c1 but not t2.c2. Also within custom function it seems to be working fine, but when caller makes the call to the function it doesn't return matching records. Any idea what could be the issue?
Buffer web query request
Hello there,
I have function which i am using to get statistics from POST method: fnMotorModes_Get
This function i invoke like Custom Function only one time in MotorModes table:
Tables MotorModesTotal and MotorModesEvents are created via Reference button from MotorModes table. When i update data i check Fiddler Web Debugger and see that PowerQuery address to web service three times. One time for every table.
What do i need to add in query to make only one request to web service?
information standardization
good morning experts
very recently I have been facing a professional challenge with production data. I am nervous because things are not going as I would like, so all the help you can give me, I will be grateful.
I have the following table (sample) onedrive table and I need to start normalizing it to make it work fine in the data model
How should it look?
Count distinct values as a measure
I have column of NPS Score from 1-10. I am trying to group them as detractor (1-6), Passive(7-8) and Promoter(9-10) in a measure. Then I want to display is pie chart. I have this:
Pre-existing Queries
Hello All
I inherited a Power BI Report from someone who left a few years ago. The current report pulls from an SQL database that is "On-Prem."
We are eventually going to discontinue the On-Prem source and pull the same type of data from the same database which is being moved to Azure.
I noticed the current Report has a ton of queries the person created and it will be difficult to trace each one to figure out what they were doing. What is the correct way to do this when moving from On-Prem to Azure----do I just point the report to the new data source in Azure? Being that it is the same database, should all the existing queries in the report run as normal when we pull in the new data?
Transform table with maximum quantity of 100 per week
I doubt that this one has a solution in Power Query, however I thought to share it on this forum, maybe!
I have a dataset of weekly orders, which I need to limit to a weekly total quantity of 100. Thus remainder should be carried over to the following week and so on, till the last week. If there is remainder you open a new week. Always respecting the upper limit per week of 100.
Dataset for original table:
Expand Columns for Table with Unknown Column Names
I seached Google for "power query expand all columns".
Top search result is from 2014 and seemed really complex, second item found did not seem simpler and only 3rd result was from this forum, by
In short, the trick is to get the list of column names (Table.ColumnNames), on the column which holds the table of unknown column names (using Table.Combine).
It you have a Table (say it is called TABLE_OF_TABLES) and it has a column that each value is a Table with unknown columns names (say column is names table_column), you can expand it using:
Table.ExpandTableColumn(
TABLE_OF_TABLES,
"table_column",
Table.ColumnNames(Table.Combine(TABLE_OF_TABLES[table_column])),
Table.ColumnNames(Table.Combine(TABLE_OF_TABLES[table_column]))
)
Since it took me some time to get is right and since this looks like a pretty common task I am posting the functions I implemented. Hope others will benefit from it.
Function GetSheetDataFromFiles
= (sheetName) =>
let
fileNames = FILE_NAMES, // A table with a single column called "Data Source File Name", each entry is a file name (full path)
readFileData = Table.AddColumn(fileNames,
"fileData",
each GetSheetData([Data Source File Name], sheetName)
),
expandFileData = Table.ExpandTableColumn(
readFileData,
"fileData",
Table.ColumnNames(Table.Combine(readFileData[fileData])),
Table.ColumnNames(Table.Combine(readFileData[fileData]))
),
removeFileName = Table.RemoveColumns(expandFileData,{"Data Source File Name"})
in
removeFileName
Function GetSheetData
= (fileName, sheetName) =>
let
Source = Excel.Workbook(File.Contents(fileName), null, true),
allData = Source{[Item=sheetName,Kind="Sheet"]}[Data],
promotedHeaders = Table.PromoteHeaders(allData, [PromoteAllScalars=true])
in
promotedHeaders
Format Panel
Hi everyone!
Do we have the possibility to enable/disable the switcher (Column subtotals) in format panel programmatically? After that, it should make an API call to powerbi.dataView and rerender the table.
Identify if string is made if of numeric values
Hi
I am trying to identify on my report, using PowerQuery, if a purchadse order number; the column is declared as a text value, had/is all nuermic values. A number of Purchase orders numbers are prefixed with a letter(s). I wanted to flag these as they are a different type of order.
I am using a couple of snippets taken from the web and came up with this:
=if
List.AllTrue({
Text.Length([PurchaseOrder])=7,
Value.Is(
Number.From([PurchaseOrder])
)
})
then "YES"
else "NO"
So I am checking if a purchase order text lenght = 7 chatacters, then I want to check if they are all nuermic. Its seems to partially work, ie its understands if it is all numeric, its just when it encounters a text character if fails and throughs up an error for thoses rows.
I asusmed adding this to an IF statement the outcomes would be false and I get my answer.
Chris.
Create list of remaining processes
So I have been working on a project that has me stumped
What i am looking to do is create a concatinated list of steps remaining. My data looks like this
part # step step description
123abc 001 cut
123abc 002 buff
123abc 003 mark
123abc 004 ship
My end resault that i am looking for is something like this
Part # Step Custom Column
123abc 001 buff,mark,ship
123abc 002 mark,ship
123abc 003 ship
123abc 004
Now there are other fields, as this data comes out of a SQL Database. I know how to create the concatinated list using group by, and how to put the if statement in. But, not how it would lookup the next value. Any help would be appreciated, Thank you.
Power Query excel
Greeting all,
I have a small project, in which i have two sql diret query tables and one excel file in that iam trying to show the total of sql and excel for the same designation and for different dates but the total of sum output displaying is correct but its display for all the designation which is wrong. requesting your suggestion for correcting the issue.
Table 1 - direct query | Punching Table - direct query | |||
Id No | Description | EmpId | PunchTime | Projectdetail |
1 | Fabricator | 1 | 17/09/2020 6:00 | Project A |
2 | Fitter | 2 | 17/09/2020 7:00 | Project B |
3 | Project A | 1 | 17/09/2020 19:00 | Project A |
4 | Project B | 2 | 17/09/2020 19:00 | Project B |
1 | 18/09/2020 6:00 | Project A | ||
2 | 18/09/2020 7:00 | Project B | ||
1 | 18/09/2020 19:00 | Project A | ||
2 | 18/09/2020 19:00 | Project B | ||
DAX Date | ||||
Excel | ||||
Date | Projectdetails | Designation | Total | |
17/09/2020 | Project A | Fabricator | 5 | |
17/09/2020 | Project B | Fitter | 10 | |
18/09/2020 | Project A | Fabricator | 6 | |
18/09/2020 | Project B | Fitter | 3 | |
Relationship | ||||
Dax date with Excel date | ||||
Excel Designation with Table 1 Description | ||||
ProjectDeatils Punching Table with Table 1 Description |
Query that doesn't work
It's probably just me... but my query isn't working. It tell me that 'G_EF.mximpl' is invalid.
Select
G.line_item_id
, G.price
, G_EF.mximpl
FROM
mn_price_master_li G
inner join
(
SELECT
max ( G_ED.date_impl ) as "mximpl"
, max ( G_ED.eff_start_date ) as "mxeff"
, G_ED.line_item_id as "Id"
FROM
mn_price_master_li G_ED
WHERE
G_ED.line_item_id = '6314925' OR G_ED.line_item_id = '908200'
GROUP BY
G_ED.line_item_id
) G_EF
ON
G.line_item_id = G_EF.id
and G.date_impl = G_EF.mximpl
and G.eff_start_date = G_EF.mxeff
But when I do the following, it does return a table with 3 columns as specified with the select statement in the from part...
SELECT
G_EF.*
FROM
(
SELECT
max ( G_ED.date_impl ) as "mximpl"
, max ( G_ED.eff_start_date ) as "mxeff"
, G_ED.line_item_id as "Id"
FROM
mn_price_master_li G_ED
WHERE
G_ED.line_item_id = '6314925' OR G_ED.line_item_id = '908200'
GROUP BY
G_ED.line_item_id
) G_EF