The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |