date ranges
4 TopicsRemoving a slicer interaction while still using the slicer value
In my report, a user will select a date using a date between slicer and we're only using the minimum date selected. This date can be any day of the week. I want to show the sales numbers for the entirety of that week. For example, if a user selects a Wednesday, I want to show the values for Sunday through Saturday of that week. I have tried several remedies, but it seems like I either show the days leading up to the selected day or the days after the selected day-- I have not been able to see the entire week at once. One attempt of a calculation was CALCULATE(sum(*redacted sales table info*),ALL('vw_D_Date'[date_value]),FILTER(*redacted sales table*,[MinimumSelectedDate])) where MinimumSelectedDate = FIRSTDATE('vw_D_Date'[date_value]) Any suggestions on how to solve this?Solved713Views0likes2CommentsExpand Dates in Large Data Set - PowerQuery and Dax
I have a large data set in a proper star schema. However, i'm struggling with some reports out of it. I'll explain what i'm currently doing, and hopefully someone can tell me a better way (or more elegant) way to accomplish something similar. Data set: There's many more tables that have proper relationships (Aprox 30 more), but for the purpose of this exercise, that's all we need. Most of the work happens in the ResourceActualDetail table it looks like this (with some columns deleted): ResourceAllocationId AllocationPercentage EndDate StartDate 794 1 4/1/2018 0:00 2/25/2018 0:00 795 1.15 3/4/2018 0:00 2/25/2018 0:00 795 1.0875 3/11/2018 0:00 3/4/2018 0:00 795 1 4/1/2018 0:00 3/11/2018 0:00 796 1.05 3/4/2018 0:00 2/25/2018 0:00 797 0.725 3/4/2018 0:00 2/25/2018 0:00 1531 1 3/11/2018 0:00 2/25/2018 0:00 1721 1 4/1/2018 0:00 2/25/2018 0:00 Desired Output: ResourceAllocationId AllocationPercentage EndDate StartDate Date 794 1 4/1/2018 0:00 2/25/2018 0:00 2/26/2018 0:00 794 1 4/1/2018 0:00 2/25/2018 0:00 3/4/2018 0:00 794 1 4/1/2018 0:00 2/25/2018 0:00 … 794 1 4/1/2018 0:00 2/25/2018 0:00 4/1/2018 0:00 Notice the 7 day increments. And the same for every ResourceAllocationID so that I can graph it like so: (error in Graph dates, should be with 7 day increments). Where there is a different line for each Resource (connected through relationships to ResourceAllocation and ResourceActualDetail). Even if we can get it to a point where we can do that for each ResourceAllocationId I can figure out the rest 🙂 Current Approach: These data tables are quite large already(~1M rows) , and my approach only has bloated that. Trying to do everything as close to the source, this what I came up with: Let Source=PowerBI.Dataflows(null), ... #"Changed Type" = Table.TransformColumnTypes(ResourceActualDetail1,{{"EndDate", type number}, {"StartDate", Int64.Type}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Dates", each List.Numbers([StartDate],([EndDate]-[StartDate])/7,7)), #"Expanded Dates" = Table.ExpandListColumn(#"Added Custom", "Dates"), #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Dates",{{"Dates", type datetime}, {"EndDate", type datetime}, {"StartDate", type datetime}}) in #"Changed Type1" Essentially, I change the StartDate and EndDate fields to numeric Values and then I calculate the beginning of each week before i switch back all those values to Date type. This part of the query doesn't fold, so I cannot take the advantage of the PowerFlow to do it. It also makes each refresh very slow (should be refresed multiple times a day). Any suggestions or ideas?? Obviously looking for the most efficient way to achieve this so that it won't take many resources (I do have a premium instance). Thanks!1.1KViews0likes2CommentsFormula to validate two date ranges
Hello All - I have a requirement where we need to write a validation either in DAX or in Power Query for the below scenario. Clone start date 9/1/2019 Clone End date 9/5/2019 CRP start date - 9/5/2019 CRP End date -10/1/2019 The scenario is that the conditional colum should populate"Risk" else "no Risk" if any one of the dates in the CRP start date and CRP end Date ( Range) fall in betweeen Clone Start - Clone end date ( Range) . Thanks in advance . SudanSolved1.2KViews0likes1CommentConsolidate data for a time range
Hi, I want to consolidate the amount of backlog from a time range, this formula should be dynamic. Backlog from 3 months and earlier (from current month) should be summarized and backlog from 4 months ahead and further (from current month) should be summarized. My purpose is to show a column chart that shows 1 bar with a consolidated backlog amount from 3 months and earlier, 1 bar for current month, 1 bar for oct, 1 bar for nov, 1 bar for dec, 1 bar for jan and 1 bar for the rest in the future. I do not want to use the filter, because this will be a monthly manual task, which I want to prevent. Date Backlog Amount 04-2019 26 05-2019 25 06-2019 20 07-2019 15 08-2019 5 09-2019 10 10-2019 20 11-2019 50 12-2019 60 01-2020 15 02-2020 12 03-2020 25Solved1.5KViews0likes2Comments