Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Community, I have a power bi dax that calculates the hours based on selected start of week. I am currently getting the correct value for week 1, however, week 2 or the following week returns the total sum of entire rows. I select the start of week using a slicer. Below is the dax I am currently using for week 1 and week 2:
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[Duration]), 'FactTable'[Date] >= Week1StartDate && 'FactTable'[Date] <= Week1EndDate )
Week2Duration = CALCULATE(SUM('FactTable'[Duration]), REMOVEFILTERS('01_Date'[Start of Week]), '01_Date'[Week ID] = MAX('01_Date'[Week ID]) + 1)
Solved! Go to Solution.
It works when I organize the relationship between tables, thank you
Hi @Anonymous yes it is, this is the current result I am getting so far:
Hi @ironboy0423
Are the date table and the fact table connected? How does your visual look like?
It works when I organize the relationship between tables, thank you
And to add to this, yes it is connected but not active, when I activate the relationship, it will introduce ambuigity to other fact table that is currently connected to date table
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |