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.
Hi Guys,
Newbie here,
May I ask how to get the last row of each ID in another table visual.
This is a streaming dataset so I cant manipulate the table.
So in the table above, I only want to show the row which contains the last task of each employee ID which should be the END for 10736211 and MEETING for 10698442.
Thank you guys for answering!
Solved! Go to Solution.
Hello @Anonymous ,
You may try:
Latest Status =
VAR _LatestTime =
MAX('Table'[Date])
VAR _FilterTable =
FILTER(
'Table',
'Table'[RecordTimestamp] = _LatestTime
)
VAR _LatestStatus =
CALCULATE(
VALUES('Table'[Task]),
_FilterTable
)
RETURN
_LatestStatus
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
@Anonymous ,
Change all min with max
Measure =
VAR __id = MAX( 'Table'[EmployeeID] )
VAR __date = CALCULATE ( MAX( 'Table'[Date] ), ALLSELECTED ( 'Table' ), 'Table'[EmployeeID] = __id )
RETURN CALCULATE ( sum ( 'Table'[EmployeeID] ), VALUES ( 'Table'[EmployeeID] ), 'Table'[EmployeeID] = __id, 'Table'[Date] = __date )
Hello @Anonymous ,
You may try:
Latest Status =
VAR _LatestTime =
MAX('Table'[Date])
VAR _FilterTable =
FILTER(
'Table',
'Table'[RecordTimestamp] = _LatestTime
)
VAR _LatestStatus =
CALCULATE(
VALUES('Table'[Task]),
_FilterTable
)
RETURN
_LatestStatus
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
@Anonymous try following measure.
Recent Task =
VAR __maxDate = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Employee] ) )
RETURN
CALCULATE ( MAX ( 'Table'[Task] ), ALLEXCEPT ( 'Table', 'Table'[Employee] ), 'Table'[Date] = __maxDate )
I would ? Kudos 🙂 if my solution helped. ?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous ,
Try a new measure like this add to your table
Measure =
VAR __id = MIN ( 'Table'[EmployeeID] )
VAR __date = CALCULATE ( MIN( 'Table'[Date] ), ALLSELECTED ( 'Table' ), 'Table'[EmployeeID] = __id )
RETURN CALCULATE ( sum ( 'Table'[EmployeeID] ), VALUES ( 'Table'[EmployeeID] ), 'Table'[EmployeeID] = __id, 'Table'[Date] = __date )
Hi @amitchandak,
You've got the correct result that I wanted however, this will show the first task not the last. I want to show the last task for each ID.
@Anonymous ,
Change all min with max
Measure =
VAR __id = MAX( 'Table'[EmployeeID] )
VAR __date = CALCULATE ( MAX( 'Table'[Date] ), ALLSELECTED ( 'Table' ), 'Table'[EmployeeID] = __id )
RETURN CALCULATE ( sum ( 'Table'[EmployeeID] ), VALUES ( 'Table'[EmployeeID] ), 'Table'[EmployeeID] = __id, 'Table'[Date] = __date )
Hi @amitchandak ,
I am experiencing another problem by using your given measure, If I add same task . the measure will give 2 outputs. It should be one and only the latest one. Please see the screenshot below.
It should be like this:
Thank you so much for answering @amitchandak ! I really appreciate it !
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
46 |