Try this NQE query.
/**
* @intent Unique MAC Address counts and their details
*/
foreach device in network.devices
foreach networkInstance in device.networkInstances
foreach macEntry in networkInstance.fdb.macEntries
group { deviceName: device.name, macEntry } as macEntriesPerAddress
by macEntry.macAddress as macAddress
let deviceNameAndMacEntry = min(macEntriesPerAddress)
let macEntry = deviceNameAndMacEntry.macEntry
select {
Device: deviceNameAndMacEntry.deviceName,
"MAC Address": macAddress,
"Address Count": length(macEntriesPerAddress),
OUI: ouiAssignee(macEntry.macAddress),
Type: macEntry.entryType,
Interfaces: (foreach i in macEntry.interfaces
select if isPresent(i.subinterfaceName)
then i.subinterfaceName
else i.interfaceName)
}