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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi I want to know how to count
From this picture
shift_date = date employee work
sum = worhing hour 8 is normal work time and 2 is overtime
So I got duplicate shift_date
group_id = Consecutive date
Count_Column = count day Consecutive
In group_id = 1 ,I should get 6
this is my dax for counting
@matus_jun , Try using Distinct
Count_Column =
CALCULATE(
COUNTROWS(
DISTINCT(
SELECTCOLUMNS(
FILTER(
ALL('table'),
'table'[employee_id] = EARLIER('table'[employee_id]) &&
'table'[group_id] = EARLIER('table'[group_id])
),
"shift_date", 'table'[shift_date]
)
)
)
)
Proud to be a Super User! |
|
EARLIER/EARLIEST refers to an earlier row context which doesn't exist.
It show like this i dont understand how EARLIER work
@matus_jun
I suggest, you transform the data in Power Query so that you will have to get rid of the duplicate records and two seperate columns one for Total Hours and one for OT, this way you will be to do your aggregations easily in Power BI
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
how to do this can you help me I try but not working