powerquery
21 TopicsCreate new table by transposing/Crosstab a data table
Hi, I need to crosstab/transpose data from one table to create a new table as shown in example below. Original Table: User Week Status A1 Week1 Active A1 Week2 Inactive A1 Week3 Deleted A2 Week1 Active A2 Week2 Active A2 Week3 Deleted A3 Week1 Active A3 Week2 Active A3 Week3 Active A4 Week3 Idle A5 Week2 Active A5 Week3 Active New Table/Changed format/Desired output: User Week1 Week2 Week3 A1 Active Inactive Deleted A2 Active Active Deleted A3 Active Active Active A4 Idle A5 Active Active Can anyone help me with the same? Thanks in advance.Solved2.9KViews1like5CommentsAverage Time by Opportunity Stage
Hi Community, I have an opportunity history table, similar to the below, and I am trying to calculate the average length of time opportunities spend in each stage. I want to plot the average time, in days, on a time series with the categorical stages as my x-axis. I've created a separate table of the each opportunity stage and a corresponding order, so the stages plot in sequence on x-axis and will connect that reference table to my Opportunity['StageName'] table to accomplish this. OpportunityId StageName Date AA Identification 1/1/23 AA Qualification 2/1/23 AA Cultivation 3/1/23 AA Verbal Commitment 5/1/23 BB Identification 2/1/23 BB Qualification 3/1/23 BB Verbal Commitment 7/1/23 I don't necessarily care about time in each stage on an individual opportunityId level, rather, I want to show that, on average, opportunities spend 30 days in Identification and so on from there. Opportunities can skip stages, though. Any help in creating a DAX measure in support of this would be greatly appreciated. Thank you!Solved1.1KViews0likes1CommentDetect if a customer is present last week
Hello, I am working on a Power BI project to identify customers who fix their leaks. I receive a weekly file that I upload to SharePoint. I then use Power Query to compile the data and create a table listing customers with leaks for each week. I am trying to create a calculated column or DAX formula (or a column) to check, for each customer and week, whether they had a leak in the previous week (S-1) and the current week (S) in a visualization table. It's important to note that only customers with leaks are present in the file each week. I've been trying to solve this problem, but I'm struggling to find a solution. If anyone has encountered a similar issue, I'm open to suggestions. client id start & end date of the week leak column i've also uploaded a calendar table ! 😞Solved524Views0likes2CommentsAddIn Link to Excel Workbook from D365 F&O
Hello, I hope someone can help. The link in the Excel Workbook keeps breaking (asking to be re-entered)? It seems to me that when it is opened directly to desktop app, it is fine (so i revert to the last version) but when it is opened in excel online the Addin for D365 needs to be re-entered and then the functionality for the refresh/publish etc goes: Sometimes this message comes up: or this:685Views0likes2CommentsServer refresh gives Table not found error but fine in desktop
I'm trying to set up my scheduled refresh for my PowerBI report - the connection is an ODBC on import, I have the required drivers and get a green check when I test the connection, however when I refresh I get the following error: SessionID: b5ba2f83-45cb-4fab-8a0e-8a79b6cdbf0c [0] -1055784932: DataSource.Error: ODBC: ERROR [42S02] [Cache ODBC][State : S0002][Native Code 30] [D:\Program Files\Microsoft Power BI Report Server\PBIRS\ASEngine\MDataEngine\Mi] [SQLCODE: <-30>:<Table or view not found>] [Location: <Prepare>] [%msg: < Table 'DBO.DSKILLSETSTAT' not found>]. DataSourceKind = Odbc. DataSourcePath = dsn=MYDSNLOCATION. OdbcErrors = #table({"SQLState", "NativeError", "Message"}, {}). . The exception was raised by the IDbCommand interface. [1] -1055784932: The command has been canceled.. The exception was raised by the IDbCommand interface. [2] -1055129594: The current operation was cancelled because another operation in the transaction failed. [3] -1055784932: The command has been canceled.. The exception was raised by the IDbCommand interface. [4] -1055784932: The command has been canceled.. The exception was raised by the IDbCommand interface. My refresh works just fine in PowerBI desktop, no issues with queries on any tables, it's clearly connecting to the source ok, I'm not sure what I'm missing. I can refresh and save the updated file in desktop and the report data refreshes on server. I'm not sure how or why it can't find the table any more. Here's a snip of the connection structure if I'm creating a new source - the table being queried is called dSkillsetStat in the dbo folder774Views0likes0CommentsHelp with a complex problem please. Have tried 2 solutions.
Hi. I have a dataset that I am pulling from my work server including a bunch of information about business, projectid(distinct), created date of these projects and so on. What I want to do is see the projects per month in line graph, which is quite simple with distinctcount(projects), put it in a graph with dates. However what I also want to see is a running cummilative total of this ine a line chart. So if may(FY start) has 110 projects it will show 110 BUT, from June it should show June figure+May figure added to it, example; 110(may)+142(june)=252 june, then 252(prior)+150 of july= 402. This is just actual projects we made. Fiscal year start = 1st may, FY end = 30 april. x-axis=date | y-axis = running cummulative total. How can I make a target projects too with this? which I want as 167 May, 167(may)+167(june)=334, 334(may,june)+167(july)=501 and so on. (Note: there is not dataset for this and I would like a solution for it). x-axis=date | y-axis = running total of "targets" I was able to comeup with a formula that does this calculation, however no slicers work on this graph. Date slicer works, but other slicers like: Project status (draft, order, offer, rejected), region(south ,west,east, north), countries does not work at all. Formula: VAR CurrentMonth = SELECTEDVALUE(VT_Projects_Summary[Month_Year]) VAR FiscalYearStartMonth = 5 // May VAR FiscalYearEndMonth = 4 // April VAR FiscalYearStartDate = IF( MONTH(CurrentMonth) < FiscalYearStartMonth, DATE(YEAR(CurrentMonth) - 1, FiscalYearStartMonth, 1), DATE(YEAR(CurrentMonth), FiscalYearStartMonth, 1) ) RETURN IF( CurrentMonth < FiscalYearStartDate, 0, SUMX( FILTER( ALL(VT_Projects_Summary), VT_Projects_Summary[Month_Year] >= FiscalYearStartDate && VT_Projects_Summary[Month_Year] <= CurrentMonth &&VT_Projects_Summary[ProjectType] = "Lowercost" ), [ProjectsPerMonth] ) ) Other solutions tried: 1) giving index to each projectid but then again it slices projects by per month and not how I want them. 2) Making a loop in powerquery which does basically what I want but adding it to graph slices it again by per month. 3) giving a manual actual and target value to each month using calculated column but then for 31 days it just says "167", Also its not dynamic and highly manual process. Any help is welcome!Solved671Views0likes3CommentsMultiple connection error when refreshing dataset
Hello, This morning all my data sets failed to refresh. This also happaned when i tried to manually trigger the refresh. Below the error message I received via email: I have checked the Fourth_DimEmployees table but on the SQL server all looks good. Also, when I manually tried to refresh it, I got the error from another table. When I try to see the raw data in PowerQuery, it times out while refreshing the page: Finally, I did not make any changes to the dataset in the last 2 weeks. So very strange to get this error. If anyone has any idea on how to fix this or if it is an issue with Microsoft, please let me know406Views0likes1CommentTopN Based on Characters
I am trying to get only the last 4 quarters or last 13 weeks that will be using for the Sparkline reference. My only reference of ranking is based on sorting it form highest to lowest. But since this are strings and not numbers, how can I use it using TopN DAX or other code function? Thanks for the help. Quarters 2020_1 2020_2 2020_3 2020_4 Weeks 2020_01 2020_02 Additional question: I only want to extract my data from SQL server for every last 5 years in power query for faster loading and refresh. Any idea on this? Thanks!927Views0likes4CommentsDAX based on same date and same field
Hi Im a bit new to dax and I am struggling in creating a formula. So I need to write a mathmateical calculation which =+(E4+Mx6)/2*33 for the East Silo on the same date and time only. So the first one would be 07/11/2022 4:30 am calculation (4+4)/2*33423Views0likes1CommentGet the Quantity by the Earliest Date
Hello, I am trying to get the most recent quantity by production week, by Plant (Where it is produced) and by SKU (Item No) depending on the earliest date (version date). Can someone help me with this. I do not mind if it is done in DAX or Power Query. Below is my data view. I have tried groups but when I try to get the quantity it sums all the values up. I dont want that I want what ever was the quantity by the earliest plan version by item. ========================================================== Example of what I want: If I were to sum the quantity of production week of 9/25/2022 I would get like 900,000 (LBS) because it sums it all. I want to get the last value depending on the earliest or closest date of that production week for that Item and plant level. Let me know if I need to clarify anything. Below is an example of why the equal dates do not work:Solved1.5KViews0likes2Comments