Data help and tips - excel

I tried to make a calender visual, like here in the forum that I posted. Unfortunatelly I don't see an other option than Restructuring my data.
My currently data is as following
Project ID | Start Phase | Planning Phase | Execution Phase | Monitor Phase | live
22193 | 18-01-2021 | 20-01-2021 | 28-01-2021 | 20-02-2021 | 03-03-2021
29193 | 20-01-2021 | 10-02-2021 | 15-02-2021 | 19-03-2021 |
87596 | 25-02-2021 | 10-03-2021 | 25-03-2021 | 30-03-2021 | 10-04-2021
And I think my restructured data will be as followed.
Phase ID | Project ID | Phase | |Start | | End |
1 | 22193 | Start | |18-1-2021| |20-1-2021
2 | 22193 | Planning| |20-1-2021| |28-1-2021
3 | 22193 | Execition| |28-1-2021| |20-2-2021
4 | 22193 | Monitor | |20-2-2021| |03-03-202
5 | 22193 | Live | | | |03-03-2021
My question is: Is there a way to add phases in my data with every Project ID in Power BI (Dax, M Or tables?). Because doing it manualy whill take for ever.
And a sidequestion, will this restructuing my data affecy my sql database?
Edit:
The top structure did not meet my needs because I want to make a calendar visual in Power BI. Unfortunatey there is no visual which accepts multiple dates, The current visuals in Power Bi only accepts 1 start and 1 end date. That is the reason to restructure my data to be able to have 1 start and 1 end date
yours faithfully

Related

How to conditionally query tables based on oData request in an Azure Logic App

I am a total newbie when it comes to both oData and Logic Apps.
My scenario is as follows:
I have an Azure SQL database with two tables (daily_stats, weekly_stats) for users
I have a Logic App I managed to test successfully but that targets one table, triggered by an HTTP request and initialises a variable using the following expression to get the query
if(equals(coalesce(trigger()['outputs']?['queries']?['filter'],''),''),'1 eq 1',trigger()['outputs']?['queries']?['filter'])
The problem comes with how to query a different table based on what the user passes as an ODATA GET request
I imagine I need a condition and the pseudo code of this would be something like:
For daily stats the ODATA query URL would be
https://myproject.logic.azure.com/workflows/some-guid-here/triggers/manual/paths/invoke/daily_stats/api-version=2016-10-01/&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=my-key-here&filter=userid eq 'richard'
For weekly stats the ODATA query URL would be
https://myproject.logic.azure.com/workflows/some-guid-here/triggers/manual/paths/invoke/weekly_stats/api-version=2016-10-01/&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=my-sig-here&filter=userid eq 'richard'
If it is daily_stats, it queries the daily_stats stored procedure/table for the user = richard
If it is weekly_stats, it queries the weekly_stats stored procedure/table for the user = richard
Edit: Added an ASCII flow diagram
+----------------------+
| HTTP ODATA GET |
| Reguest |
| |
+----------+-----------+
|
|
|
|
v
+-------+---------+
| |
| |
| |
| filter has |
| daily_stats |
| |
+-------+---------+
|
|
|
|
+-------------+ | +--------------+
| | | | |
| | YES | NO | |
| query +<--------------+-----------------+ query |
| daily | | monthly |
| stats | | stats |
| table | | table |
| | | |
+-------------+ +--------------+
There is a switch action, further more information you could refer to here:Create switch statements that run workflow actions based on specific values in Azure Logic Apps.
Below is my sample, switch statements support only equality operators. If you need other relational operators, such as "greater than", use a conditional statement.

Formula to Repeat and increment Numbers and reset when ID changes

I am looking for a start in the right direction and I hope someone on this forum has run into this issue. I have an excel table with 24K jobs on it and a technician assigned to every job. These technicians have 40 weeks to complete all the jobs assigned. I have a helper table with each technician’s id and how many jobs per week then need to complete all the work. I have sorted the jobs by geographic area for efficiency. I need a formula that will look at the Technician id and if they are receiving 3 jobs per week that it will number the first 3 with a 1, and the next 3 with a 2 and so on. And when it switches Technician it would reset the counter.
In the example below Tech 1 is assigned 3 jobs per week, and Tech 2 has 2 jobs per week.
| JobID | Tech | Grouping |
|-------|--------|----------|
| BK025 | Tech 1 | 1 |
| CD044 | Tech 1 | 1 |
| DE024 | Tech 1 | 1 |
| DE031 | Tech 1 | 2 |
| DE035 | Tech 1 | 2 |
| FT083 | Tech 1 | 2 |
| IR004 | Tech 2 | 1 |
| IR006 | Tech 2 | 1 |
| IR052 | Tech 2 | 2 |
| IR061 | Tech 2 | 2 |
| IR062 | Tech 2 | 3 |
| IR072 | Tech 2 | 3 |
I have been searching SO and Google looking for an answer but may not be using the correct key words.I have found this formula =ROUNDUP((ROW()-offset)/repeat,0) -- Found on exceljet -- which will work, but in order to get it to work properly I would have to filter to each tech individually.
Assuming your helper table is something like in the screenshot below, you could use an approach like the following:
=ROUNDUP(COUNTIF(B$2:B2,B2)/VLOOKUP(B2,$E$1:$F$3,2,0),0)

How to create a column showing if a value is in the bottom 10 values?

I have a large data set that contains details about objects that are currently on an extension. The extensions are given a specific due date. Some of the extensions are past their due date.
I'm struggling to work out how to create a column in PowerPivot for O365 Excel that will return a yes/no value depending on if the object is one of the 5 most overdue extensions. So far nothing I've tried has worked at all.
Example with fake data:
+-----------+---------+--------------------+------------+
| ID | Urgency | Bus Days Remaining | Due Date |
+-----------+---------+--------------------+------------+
| 118017544 | Overdue | -487 | 1/04/2017 |
| 34960939 | Overdue | -97 | 30/09/2018 |
| 10695082 | Overdue | -364 | 20/09/2017 |
| 166236826 | Overdue | -86 | 15/10/2018 |
| 166236826 | Overdue | -86 | 15/10/2018 |
| 34944450 | Overdue | -437 | 9/06/2017 |
| 69427293 | Overdue | -446 | 29/05/2017 |
| 56280961 | Overdue | -437 | 9/06/2017 |
| 12535364 | Overdue | -176 | 11/06/2018 |
| 46296100 | Overdue | -163 | 28/06/2018 |
| 171666963 | Overdue | -122 | 24/08/2018 |
+-----------+---------+--------------------+------------+
The calculated column should be able to put a "Yes" next to 5 rows in this data that are the oldest.
Factors that might be important:
Multiple extensions can share a due date but be separate extensions. This makes me think that the formula needs to be based off of the "Bus Days Remaining" column value
Excel has a function in Pivot Tables where you only show the Top 10 values. This isn't an option for me because using that filter means you cannot drill into the Pivot Tables data.
Any help you could provide would be great :)
Thanks in advance
Please try this formula.
=C2<=SMALL(C$2:C$12,5)
If the 5th and 6th smallest are equal the formula will return TRUE for more than 5 items.

spotfire how to get the last value in a column?

I have a data table as below. I would like to get the last [Action] of each [Sstage] of each [ID] based on the [Time].
I tried: last(action)over intersect([id],[stage],[time]) but it is not giving me what I want. does anyone have any idea?
+----+---------+-----------------+------------+-----------------+
| ID | Stage | Action | Time | Last_Action |
+----+---------+-----------------+------------+-----------------+
| 1 | CEO | Decline | 11/01/2016 | requestmoreinfo |
| 1 | CEO | Approve | 11/02/2016 | requestmoreinfo |
| 1 | CEO | Approve | 11/03/2016 | requestmoreinfo |
| 1 | CEO | requestmoreinfo | 11/04/2016 | requestmoreinfo |
| 1 | Manager | requestmoreinfo | 11/05/2016 | Decline |
| 1 | Manager | requestmoreinfo | 11/06/2016 | Decline |
| 1 | Manager | Approve | 11/07/2016 | Decline |
| 1 | Manager | Decline | 11/08/2016 | Decline |
| 2 | User | Decline | 11/09/2016 | Approve |
| 2 | User | Decline | 11/10/2016 | Approve |
| 2 | User | Approve | 11/11/2016 | Approve |
+----+---------+-----------------+------------+-----------------+
This one probably isn't as obvious as most.
We have to find out what the status is for the Max([Time]) over the [ID] and [Stage]. You are close using Last() but that method is to get the logical last row. If your data isn't sorted... then this would give undesired results. Thus, use the Max() method to get the most recent date.
Max([Time]) OVER (Intersect([ID],[Stage]))
Now... this would put the [Time] in your calculated column... since you want the correlated [Action], we need to nest that in an IF() statement to find the [Action]
If([Time]=Max([Time]) OVER (Intersect([ID],[Stage])),[Action])
Now, this would put the correct [Action] in your calculated column, but only on the row containing the Max([Time]).
The last step is to apply this value across your [ID],[Stage] grouping with one more Over() method
First(If([Time]=Max([Time]) OVER (Intersect([ID],[Stage])),[Action])) OVER (Intersect([ID],[Stage]))

Microsoft Excel - Use a drop down list to extract data from another workbook

If i select an option from a drop down list, how do i then display data extracted from another workbook. So far, i have seen examples of showing single row data from another worksheet. But i have yet to see a method of extracting multiple rows and columns of data from a different workbook.
Week 1.xls:
A B C
-------------------------------------------------
| SKU | Description | Vendor Style |
-------------------------------------------------
| | | |
| 000001 | Description 1 | CA0080-03E |
| 000002 | Description 2 | EX1134-59D |
| 000003 | Description 3 | EM0132-59A |
| 000004 | Description 4 | EW8694-52D |
| 000005 | Description 5 | FC0003-18D |
| 000006 | Description 6 | EK2273-59E |
Master.xls:
A B C
------------------------------------------------- ________ _
| SKU | Description | Vendor Style | |________|>| <---Drop Down List
-------------------------------------------------
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
If i choose, e.g. Week 1 in the drop down list. I want the data from Week 1.xls to fill in the table in Master.xls.
If i choose, e.g. Week 2 in the drop down list. I want the data from Week 2.xls to fill in the table in Master.xls.
Is this possible? I'm thinking vlookups may be involved here in order to point to each workbook.
Thank you.

Resources