Search code examples
powerbidaxdata-analysispowerbi-desktopmeasure

USERELATIONSHIP together with FILTER in CALCULATE


I have a dax formula which counts rows based on dates:

Avsluttet = CALCULATE(COUNTROWS(TICKET),USERELATIONSHIP(Dato[Opprettet dato], TICKET[closed_at]))

But the column closed_at cointans "null" data that I want to exclude. How do I implement filter in the code above, so it only count rows containing dates?

enter image description here

I have to keep "null data" in this column because it is connected to another column in the same dataset.

Thanks!


Solution

  • Avsluttet = CALCULATE(COUNTROWS(TICKET),NOT(ISBLANK('Table'[closed_at])), USERELATIONSHIP(Dato[Opprettet dato], TICKET[closed_at]))
    

    Just add a comma and your filter condition to calculate.