max
47 TopicsRolling Date Identifiers
I support a team monitoring weekly captured data from a 5 week window. Each row of my set has a specific date - thousands of rows of data fitting into 5 weeks, and my report needs to dynamically compare each week's data with the others. I'm working to prep DAX to assign number 1-5 to each of the weeks as the project rolls on. So currently: Dec 22 = 1, Dec 29 = 2, Jan 5 =3, Jan 12 = 4, Jan 19 = 5. Next week: Dec 29 = 1, Jan 5 = 2, Jan 12 = 3, Jan 19 = 4, Jan 26 = 5 and so on.. First time in the forums so please let me know if I need to provide additional context.Solved1.2KViews2likes6CommentsCalendar Table returning error: The expression specified in the query is not a valid expression
I am racking my brain. I am building a PBi dash from a SharePoint list. Before, the list had only a few lines of test data, so I had no problem creating the calendar table. However, I have a second data source, and I needed to build a calendar based on both sources' tables to make a splicer to filter visuals by date. At first, I thought the issue was that I had 2 data sources, so I combined them into 1 data source and simplified my DAX Date = CALENDAR( MIN('Deskside QA'[DateofQA]), MAX('Deskside QA'[DateofQA]) ) But after that, I get the error "The start date in Calendar function can not be later than the end date." So I added variables to lock down the functions Date = VAR MinDate = CALCULATE(MIN('Deskside QA'[DateofQA])) VAR MaxDate = CALCULATE(MAX('Deskside QA'[DateofQA])) RETURN IF( ISBLANK(MinDate) || ISBLANK(MaxDate) || MinDate > MaxDate, CALENDAR(TODAY(), TODAY()), // Fallback to a single day calendar if dates are invalid CALENDAR(MinDate, MaxDate) ) But then I get the error "The expression specified in the query is not a valid expression" I have been running in circles and throwing in curly brackets but nothing seems to give me a solution.Solved3.5KViews1like10CommentsSame Period Last Year with Filter
I simply want to return results from last year based on the number of months that have passed this year. So this year would be January through October have passed. I want to get last years results January through October, so I'm trying to filter using MAX Calendar Date. This below is not working and is computing the results of this year and not last year. GA LY = CALCULATE([Gross Adds],FILTER('Calendar','Calendar'[CalendarDate]=MAX([Calendar Date],SAMEPERIODLASTYEAR('Calendar'[Calendar Date]))))Solved2.2KViews0likes10CommentsFilter a Line Chart via DAX Measure to report ONLY for Max Date
Hi all, I have a requirement from our userbase that they'd like to be able to switch between measures reported in a line chart. The trouble I'm running into is that some of these measures can only be reported as of the max date - metrics such as Open Roles, % of Employees on a Succession Plan, etc. Using the 'Open Roles' measure as an example, when a user selects the option on the left for 'Open Roles', I'd like the Line Chart to ONLY report the value for the maximum selected date and exclude the other Month/Year values from the axis: I've tried MAX/MAXX/etc but am coming up short. Any ideas?595Views0likes3CommentsMAX DAX Function giving incorrect sum
Hi, I have a requirement where I have to multiply an amount by 5 if the current month is the first month of quarter, else multiply by 4. Ex: if the month is January(1), April(4), July(7), October(10) then multiply by 5, else multiply by 4 for the rest of the months. I have written below DAX formula for it: This gives proper result in most cases where all the months are either start of the month (any combination of 1, 4, 7 ,10) or the other months (any combination of 2, 3, 5, 6, 8, 9, 11, 12). But gives incorrect result when the months selected are a combination of start of quarter months and other months (ex: 10 and 11). Below is the snapshot of the result: This example should sum to 8,930,815.3 but currently it shows 7,948,491.08. Kindly advise what can be done to achieve the correct results, or if anything is not right in the applied DAX formula. Thanks in advance!Solved798Views0likes2CommentsMAX Date with Filters
I have physical date and workflow status. I am needing the latest "physical date" to todays date with the workflow status not including "received pricing". How many days between the max "physical date" to todays date not including the workflow status "received pricing." Please advise. Thank you!Solved819Views0likes3CommentsHow do i find a maximum value based on 2 columns?
Hi There I am trying to figure out how to pull out a calculation called 'based units' which would be the MAX of units non promo but it needs to be by EAN_item and MrktID and NOT period_key as i am trying to evaluate a consistant units sold week on week that wasn't on promotion. It has to stay consistant through every period. Below is an example of the data and wondered if anyone knows what query to use? I've tried CALCULATE MAX across ALL Periods but this wouldn't put product and mrkt into context. Any ideas on how i can do this? The end goal would to get to something like this (and if total units sold is less than base it would equal total units) with incremental units being (total units - incremental units) : Many Thanks! 🙂Solved488Views0likes1CommentGet Last Month Data thru DAX
Hi, I am showing the trend of 3 measure values for last 12 months, but user want to know the % of last current month data as well. Then I used below DAX functions which helped me not to write one more sql code. CALCULATE(SUM('Total Open'[Opened]) ,FILTER(ALL('Total Open'[Month]), 'Total Open'[Month] = MAX ('Total Open'[Month])) ) I used this code for all 3 measure seperately and then use "100% Stacked Column Chart" to display.2.4KViews0likes1CommentHow to get sum of sales from Max weeks in a quarter
Hi, I have a table with quarters and weeks, where the sales is a snapshot of the sales at x weeks into the quarter (cumulative). I'd like to get a sum of all sales filtering only for the latest weeks in the quarter (lines in red below). The issue I'm running into is that the Max-Weeks formula I use tends to only capture the absolute max of all weeks and ignores the max weeks per quarter. The formula I'm working with is below. Any help? Qtr Weeks Sales Q1 1 1000 Q1 2 1200 Q1 3 1500 Q1 4 1600 Q2 1 500 Q2 2 600 Q2 3 800 Q2 4 1000 Q3 1 200 Q3 2 400 Q3 3 600 Q3 4 800 Q4 1 200 Q4 2 300 Measure = var MaxWk = MAX(Table[Weeks]) return CALCULATE( SUM(Table[Sales]), Weeks = MaxWk)586Views0likes1CommentHighlight cell if value is .3 higher than next highest value
Hi So I am trying to apply conditional formatting to a matrix (based on a bunch of avg values) which I know how to do but I need help with the dax command to use. Basically what the title says, very easy to explain I basically want a cell highlighted if the max value is .3 higher than the second highest value. I'll provide a sample of what I am looking for. person1 person2 person3 person4 person5 4.2 3.9 3.8 3.4 3.6 3.1 4.1 3.6 3.7 3.6 4 3.9 3.8 3.6 3.2 so the ones highlighted in orange are .3 higher than the 2nd highest value in its row and in the 3rd row nothing is highlighted because it isn't .3 higher.509Views0likes1Comment