average
87 TopicsDAX Formula for Weekly Average, to work with Date Range slicer
Hello Everyone, I was hoping you'd be able to help me with getting a DAX formula together. A bit of context - I have a dataset with a date table, and a table which is a list of 'Tickets issued'. They are linked via Issued Date. I am trying to get the average number of of tickets Issued a week, for each location (tickets have the location that they were issued to). I currently have the following DAX, but it isn't calculating properly (e.g. giving a greater average for a location with a lower number of total issued - see snapshot below) and I think this due to the 'Week Number' resetting at the start of each year, when my data spans 3+ years: Average Issued = AVERAGEX(VALUES( 'V_Date Table'[WeekNum]),[Total Issued]) Date Table = V_Date Table = ADDCOLUMNS (CALENDAR (DATE(2017,1,1), DATE(2025,12,31)), "DateAsInteger", FORMAT ( [Date], "DDMMYYYY" ), "Year", YEAR ( [Date] ), "Monthnumber", FORMAT ( [Date], "MM" ), "YearMonthnumber", FORMAT ( [Date], "MM-YYYY" ), "YearMonthShort", FORMAT ( [Date], "mmm-YYYY" ), "MonthNameShort", FORMAT ( [Date], "mmm" ), "MonthNameLong", FORMAT ( [Date], "mmmm" ), "WeekNum",WEEKNUM([Date],2)) Total Issued: Total Issued = DISTINCTCOUNT(R_Issued[Reference]) [Reference] is just a unique reference code for each ticket. Snapshot of current DAX not working (for a date range of the last 6 months, e.g.): Does anyone have a way to calculate this, (or know where I am going wrong), so that it works with any date range? Any help will be really appreciated! 🙂 Many thanks, HelenSolved30KViews0likes5CommentsMeasure for Average displayed in Card Visual
Hello guys, I am displaying a Matrix visual in Power BI that shows me a specific value for business units. Business Unit Cost 1 1,000 2 2,000 3 1,500 4 2,500 Total 7,000 The Cost Value in the visual contains a measure which looks something like this: Cost = CALCULATE( SUM(table1[values]), FILTER(table2, table2[header] = "costs"), FILTER(table3, NOT(table3[business_units] = "2222") ) I want to add a slicer visual to be able to select a specific date so the matrix visual shows the values for the date i select in the slicer. Now I also want to add a Card visual that shows me the Average of the [Cost] measure values depending on the dates I selected in the slicer. For example: If I select Jan 2020, Feb 2020 and March 2020 the card visual shows the Average [Cost] for the selected months. If I select Jan - Dec 2020 the card visual shows the Average of the whole 12 months in the year. How do I write a measure to give me such an interactive Average? Thank youSolved8.8KViews0likes10CommentsAverage of a Measure for a period of time
I have a measure called "First30Days" that goes back for 30 days of the Daily Sales and summarizes 30 days of sales for each calendar day. (I know the dataset is not every calendar day, that is ok.) First30Days = CALCULATE(('SalesTable'[DailySales]),DATESINPERIOD('Date Dim'[Date],NEXTDAY('Date Dim'[Date])-30,30,DAY)) As the screenshot indicates, this works fine and as expected. What I can't seem to figure out is how to average the First30Days column over 30 calendar days. I should end up having a new measure that shows me the 30 day average of the First30Days. Based on the screenshot, i should get 647,547 in my new column on the last row. (And, I will get a result in each row, but I am only showing for that one day in this example.) Year Quarter Month First 30 Days AVERAGE OF First 30 Days 2020 Qtr 2 June 22 $492,785 2020 Qtr 2 June 23 $515,496 2020 Qtr 2 June 24 $563,194 2020 Qtr 2 June 25 $589,350 2020 Qtr 2 June 26 $581,721 2020 Qtr 2 June 29 $612,746 2020 Qtr 2 June 30 $647,252 2020 Qtr 3 July 1 $660,788 2020 Qtr 3 July 2 $669,226 2020 Qtr 3 July 3 $629,239 2020 Qtr 3 July 6 $649,151 2020 Qtr 3 July 7 $680,475 2020 Qtr 3 July 8 $678,310 2020 Qtr 3 July 9 $679,352 2020 Qtr 3 July 10 $671,994 2020 Qtr 3 July 13 $678,355 2020 Qtr 3 July 14 $718,676 2020 Qtr 3 July 15 $732,290 2020 Qtr 3 July 16 $733,909 2020 Qtr 3 July 17 $704,970 2020 Qtr 3 July 20 $709,198 647,547Solved7.6KViews0likes4CommentsRolling Average not including months with no data
I am looking to create a measure that returns the Rolling Average of 3 months. But I do not want to have it include months that have no transactions. So, if months 1 and 3 have data, but not month 2, I would add up months 1 and 3 and divisde by 2, not 3. But if all three had data, then it would divide by three. I already have measures that return the totals for each month, and thought I could use that, but am puzzled out how to come up with the divisor. Any help would be greatly appreciated. Another approach I was trying, if the above has no solution, was to count the number of transactions for each mnth and then for those not equal to zero, come up with the months with a valuse and use that to count the months with data. But that is messy sounding and I still couldn't figure out how to do that either. Ugh.Solved7KViews0likes12CommentsCalculate Average of Distinct count values by summarizing columns(Need Measure or Column not table)
Hello Team, I need your suggestions in creating Average value for Distinct count of ID's after summarizing three columns in a table. ID Category Code Date Subject Type 1 A X 7/20/2020 ABC Sales 1 A Y 7/21/2020 ABC Sales 2 B Z 7/20/2020 DEF Purchase 3 B Z 7/22/2020 DEF order 4 B Z 7/23/2020 XYZ order What I need is to Create Calculated column/ measure which gets Average of distinct count of ID column after summarizing Category, code, date, subject columns. Please suggest me dax code for this, Thank you,5.4KViews0likes6CommentsAverage without Filter context
Hi. Im trying to create a measure (average of grading), with has filter context with the classes(Math, history, geographics), but doesnt change when i filter a student name. My tablle have the Fields: studentsname, classes, content, test_grade. For example: Students_name: Jhon, Classes: Math Contents: geometry, calculation, logic, etc. Test_grading: 9.5, 10, 8.5, etc I need to create a measure with the average of all test_grade students for each classes. I want to compare the Math average of each student with de general Math average(of all student). And my difficulty is to create the all_students average for each class. Because when filter the student name, the general average changes too the same average of the selected student. Can anyone Help me How o can do this?Solved5.2KViews0likes2CommentsAverage of Count within a group
Hi all, Im looking for a single measure I can place in a card that displays the average number of items in a group category. In the dataset below, I'd like the card to display 3 which is the average count of Item Codes per Office Location. Item codes are unique. Have tried several variants using GROUPBY but no success. Thanks for any help! Data Looking for overall average: Office Loc code Office Item Code Avg Items OfficeA Office location A A00025 OfficeA 4 OfficeA Office location A A00049 OfficeB 2 OfficeA Office location A A00073 OfficeC 3 OfficeA Office location A A00193 Overall Average: 3 OfficeB Office Location B A00313 OfficeB Office Location B A00385 OfficeC Office Location C A00409 OfficeC Office Location C A00481 OfficeC Office Location C A00505Solved5.2KViews0likes2CommentsDAX problem sum average
Hi, i have a issue about my dax measure. SUM( fac_compras[cantidad] ) * CALCULATE( [avgCosteUnidad]; SAMEPERIODLASTYEAR(dim_date[Date] ) ) all is right, but the total multiplie total quantity (costeTotalTarLY) by average cost (Avg C.Und LY) and i need a sum of total. The total was be around 550.000 but is 3.109.896 Thanks for allSolved5KViews0likes6CommentsHow to combine SUMMARIZE table with the Original Table?
Please see attached screenshot. I have an OG table (left). I then can use a SUMMARIZE function to create the middle table, which shows the AvgNumHours. I would like to combine the results to my OG table. My goal is to get to the table on the right exactly as shown with the blank spaces too. Is there a function or expression I can use to get to that table? Thanks!Solved3.4KViews0likes5CommentsCohort Analysis: Average Churn Rate
Hello, I'm new to Power BI and got struck while performing cohort analysis on customer data and trying to calculate the average across same row from multiple columns. I couldn't find any solutions related to it. So to start, I have created a dummy table with generate series to use it in cohort analysis and finding customer's that are retained. Upon doing that I have following as an example: Customers that are joined in Jan 2021 have retention rate of 96.4% for a month after. I have calculated month over month churn rate. My goal is to get the average churn rate for customers joined in January 2021 based on their churn rates in months after. For example: Average churn rate for customers joined in Jan 2021 = 0.46 + 15.53 + 16.48 / 3 = 10.82 per month. In this way I can use it to calculate the lifetime of a customer based on the average churn rate for customers that have their first sales on specific month. Hope this is clear. Could someone please guide them how to proceed? Thanks a lot in advance. Kind regards, KarthikSolved3.1KViews0likes3Comments