Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a report that shows shows the hours by employee by day and with weekly totals; goal is to filter the large list to only show employees that have hours below an expected total (assume 40/week). Report is setup as follows:
Rows
Name (from reference table with all employee names)
Columns
Week Ending (from reference date table)
Date (from reference date table)
Values
Hours (actual hours by employee for the date/week ending from the data table)
I have the following measure that calculates the actual hours by week and compare to the weekly baseline hours:
WeekVar =
--DONT CHANGE, USED FOR CONDTIIONAL FORMATTING
IF(
CALCULATE([Hours],
all(refDates[Date]))
-
Calculate([BaseHrs],
all(refDates[Date]))
<0,1,0)The measure works correctly when I apply conditional formatting to highlight where an employee is short on time, however I want to also use the measure to filter out employees who are OK on time.
When I apply this measure on the visual as a filter, it takes all of the time in the visual less base hour, rather than the weekly snapshot, i.e. if someone worked 45 hrs this week and 38 last week, the total (83) > 80 base so they're dropping off.
What do I need to fix?
Thanks
Hi @crkursel ,
You could remove ALL() function. It returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied.
Thanks for the feedback, I realize I didn't explain the situation as well as I should have so here's an example mockup in Excel.
Thanks
You are using "ALL()" which overrides any measure restricting the rows to be calculated to a specific week.
Help when you know. Ask when you don't!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 103 | |
| 66 | |
| 65 | |
| 56 |