previous week
4 TopicsCalculated columns for previous weeks values
Hi guys, I have a long table of weekly shares (Share) of several products (SKU) in different regions (Region) as below with the yellow column names. I wish to add 3 calculated columns which present the previous week (-1 WEEK) share of the same product in the same region - same thing for the week before (-2 WEEK) and before that (-3 WEEK). Please help. ThanksSolved656Views0likes2CommentsSum previous complete week and return zero for schools that had no values in previous week
I am trying to sum the number of positive COVID cases at local schools for the most recent complete week (a complete week ending on Sunday). I update the data each week so I am trying to build a formula that updates the “new cases last week” value automatically. The challenges: Some schools report new cases daily while others do not report any data for an entire week. For schools that did not report anything the previous week, my (broken) formula returns the value from the most recent week available for that school, even if it is not from the previous week. That is not what I want! If a school made no reports last week, I’d like the formula to return “0”. The MAX function and LASTDATE function filter to the last week of data in my dataset, but I run this report on Wednesday so the MAX date and LASTDate target the incomplete current week. I want the most recent complete week of data. In the end, I want a table with a row for each school that shows the number of total cases and the number of new cases last week. I tried many, many calculations. Here are a couple of my failures. I was trying to use minus 7 to bring me to the previous complete week. In the second example, I use a date table. Example 1 NEW positive_ALL = CALCULATE(SUM(schools[positive_all]), LASTDATE(schools[Week end date]-7)) Example 2 NEW positive_ALL = CALCULATE(SUM(AllSchools[positive_ALL]),('AllSchools'[Week end date]= (MAX(Datetable[WeekEndDate]-7)))) Here is a link to some sample data I uploaded on WeTransfer. In the sample, there are at least two schools, Emma Willard and Catholic Central High, that did not submit data for the most recent week, which ended on Oct. 31. Thanks for any guidance you may provide.Solved938Views0likes2CommentsDynamic 13 weeks based on WEEK SELECTION [DD-MM-YY]
Hi Power BI Community I'm trying to create a dynamic 13 weeks selection based on week DD-MM-YY which should dynamically populate 13 weeks data instead of individual selection. I check the earlier solved DAX query which is mostly based on 13-weeks selection. https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123. Thanks [@AmitChandak] Currently, I'm using this DAX which is partially doing the job, where I've to select the whole 13 weeks to achieve the desired output, instead, I need one single selection and it should populate the previous 13 weeks data before that without selecting prior 13 week value in the slicer. In my use case, I'm using Line and Clustered Column Chart that should dynamically change e.g. when I select Week Commencing e.g. 13-12-2020 (Please note I'm using DD-MM-YY not Week number), it should pull data from 13-12-2020 to 20-09-2020 or if I select 20-12-2020 the data range should be till 27-09-2020 so that I can see how my last 13 sales are doing. As shown in sample datasets and Line https://drive.google.com/file/d/1xk1xlvWiFcGTUH_8X_1R5OwwARVm11NP/view?usp=sharing and Clustered Columncharts. I've attached sample data, DATE table, and DAX measure formula Please help. Many Thanks4KViews0likes1CommentSales amount previous week (snapshot)
Hi, everyone I hope someone can help me I include the image to explain what I want to do. I would like to show how sales amount have been increased every month per week. To do that, I have tried to create a measure with this phormula. Sales amount last week = CALCULATE(SUM('Sales'[Sales amount]);FILTER(DimTable;DimTable[WeekCount]-1)) However, when I include the measure in the table, the result is the same than Sales Amount current week. Does anyone know how can I do that?. Thanks,Solved25KViews0likes6Comments