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
Hi Power BI community
I have a table called WorkPlanEntry with all the workday that are planned for a company.
My problem is that whenever a plan is edits the data added as a row in the table, but the old row is not deleted.
The table has three Columns
[User_id] (a number that indicate which user we are looking at.)
[Date] (is the date where the holiday is planned.)
[Unique_id] (a number that gets higher the later the the plan is added to the system.)
If a day is planned twice for the same [User_id] we should only look at the plan with the higehst [Unique_id] since its an edit.
My Dax right now look like this
Measure = COUNTROWS(RELATEDTABLE('WorkPlanEntry')
It adds all the rows togther but gets to many rows when I have the table has been edited.
Can anyone help me remove the extra rows?
All help that gets me closer to a solution is greatly appreciated
Solved! Go to Solution.
@ThomasWeppler , You can try creating new calculated table
LatestWorkPlanEntry =
SUMMARIZE(
'WorkPlanEntry',
'WorkPlanEntry'[User_id],
'WorkPlanEntry'[Date],
"LatestUniqueID", MAX('WorkPlanEntry'[Unique_id])
)
This table will contain only the latest entries for each User_id and Date.
Proud to be a Super User! |
|
From your description, it seems ([User_id], [Date]) can be used as "composite key"; thus
= COUNTROWS( SUMMARIZECOLUMNS( WorkPlanEntry[User_id], WorkPlanEntry[Date] ) )
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
@ThomasWeppler , You can try creating new calculated table
LatestWorkPlanEntry =
SUMMARIZE(
'WorkPlanEntry',
'WorkPlanEntry'[User_id],
'WorkPlanEntry'[Date],
"LatestUniqueID", MAX('WorkPlanEntry'[Unique_id])
)
This table will contain only the latest entries for each User_id and Date.
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 61 | |
| 43 | |
| 40 | |
| 38 | |
| 22 |
| User | Count |
|---|---|
| 178 | |
| 125 | |
| 116 | |
| 77 | |
| 54 |