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
Below is a robust measure that does exactly that. It also works when you put Message on rows in a visual. The measure always chooses the last message per PDL inside the latest hour without letting the Message filter change which row is last. Replace 'ANALYSE PRV MESURES' with your table name if needed, and replace [MESSAGE] with the real message column.
Last messages in latest hour
LastMessagesLatestHour =
VAR lastTime =
CALCULATE(
MAX('ANALYSE PRV MESURES'[DATETIME]);
ALLSELECTED('ANALYSE PRV MESURES')
)
VAR lastHourKey = INT(lastTime * 24)
VAR hourRowsNoTypeFilter =
CALCULATETABLE(
FILTER(
ALLSELECTED('ANALYSE PRV MESURES');
INT('ANALYSE PRV MESURES'[DATETIME] * 24) = lastHourKey
);
REMOVEFILTERS('ANALYSE PRV MESURES'[MESSAGE])
)
VAR lastPerPDL =
SUMMARIZE(
hourRowsNoTypeFilter;
'ANALYSE PRV MESURES'[PDL];
"LastTime"; MAX('ANALYSE PRV MESURES'[DATETIME])
)
VAR lastPerPDLJoinReady =
SELECTCOLUMNS(
lastPerPDL;
"PDL"; 'ANALYSE PRV MESURES'[PDL];
"DATETIME"; [LastTime]
)
VAR lastRows =
NATURALINNERJOIN(
hourRowsNoTypeFilter;
lastPerPDLJoinReady
)
VAR typeFilter = VALUES('ANALYSE PRV MESURES'[MESSAGE])
RETURN
IF(
ISEMPTY(typeFilter);
COUNTROWS(lastRows);
COUNTROWS(
FILTER(
lastRows;
'ANALYSE PRV MESURES'[MESSAGE] IN typeFilter
)
)
)
Hi @Anonymous
Could you please share sample dataset and expected output.
Thanks,
pravin
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 32 | |
| 19 | |
| 12 | |
| 10 |