Two different series with same tag values?

Hi,
I have a problem that I can’t explain for myself:

The following query gives me two results, although the tags “meter” and “tarif” have the exact same values:

from(bucket: "sensors")
  |> range(start: -15y)
  |> filter(fn: (r) => r["_measurement"] == "zählerstand" and r._field == "pv_produktion_west")
  |> count()

Wtf?
Can someone explain this to me and how I could fix this?

The story behind this is:
I had my historic values in another bucket, but had some bad design decisions regarding tags.
I then updated my Home Assistant to send the new sensor values to the new bucket “sensors”.
After that, I wrote a migration query that creates the right records and writes to “sensors”. Before you ask: yes, I specified tagColumns:

...
|> to(bucket: "sensors", tagColumns: ["meter", "tarif"])

Thanks,
Steven

Hello @Steven_Weiss,
Hmm I’m quite confused by this as well. What the heck is right. Maybe there’s a space somewhere in the line protocol for some of the tag values? The tariff tag value is odd.
Either way you can solve this strange issue by adding a |>group() before the count.