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.
I think the best solution to my problem is to create a running total column for a table. I need to sum hours by employee for continous dates. I'll then be using the numbers in that column do do further filtering.
Below is an example of my data:
Each time there is a gap in the date sequence for an employee, I need the running total to start over on summing the hours.
@mvgust , apparently, [Timecard ID] column already bins the table by consecutive days, thus you can authored a formula for calculated column like this,
Running Total =
SUMX (
CALCULATETABLE (
Data,
ALLEXCEPT ( Data, Data[Timecard ID], Data[Employee ID] ),
Data[date] <= EARLIER ( Data[date] )
),
Data[Hours]
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
While my table has timecard ID I can't use this as part of my context as we're looking at consecutive days regardless of what timecard the days fall into.
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
14 | |
8 | |
5 |