The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello, I am currently updating this dax to make sure that I am getting the correct value from table2durationhours column - this is a calculated column from another table. However, when I use this dax it sum up all the rows from table2durationhours resulting to very large hours for 1 date. For example, there are multiple rows for 06/05/2022 and it sum up all of these, and it should be for 1 row only. Please see below dax I am currently using:
Week1Duration = VAR SelectedWeekStart = SELECTEDVALUE('01_Date'[Start of Week]) VAR Week1StartDate = CALCULATE(MIN('01_Date'[CalendarDate]), '01_Date'[Start of Week] = SelectedWeekStart) VAR Week1EndDate = Week1StartDate + 6 RETURN CALCULATE( SUM(FactTable[Table2DurationHours]), 'FactTable'[Date] >= Week1StartDate && 'FactTable'[Date] <= Week1EndDate )
Week2Duration = CALCULATE(SUM('FactTable'[Table2DurationHours]), REMOVEFILTERS('01_Date'[Start of Week]), '01_Date'[Week ID] = MAX('01_Date'[Week ID]) + 1)
Example table:
hello it looks like table2duration already sums up by date the value of duration hours , so when you are doing the sum of table2 , you are actually summig up the total again so maybe just use max?
Hello, yup, right. I am doing the max calculation for week 2. However, it still returns a very large values.
What is the best way to filter each max value per date?
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |