Forum Discussion

sbuster's avatar
sbuster
Helper I
3 years ago
Solved

Query optimization assistance

Hello, I am trying to see if there is a way to optimize the measure in the sample attachment.  The model details an asset (automobile) with events (EventFacts) on a given date.  Each automobile may ...
  • tamerj1's avatar
    3 years ago

    Hi sbuster 

    Please try

    Count of Assets Reporting =
    COUNTROWS (
    DISTINCT (
    SELECTCOLUMNS (
    FILTER (
    EventFacts,
    EventFacts[AssetID] IN ( DISTINCT ( AssetEventMapping[AssetID] ) )
    ),
    "@AssetID", EventFacts[AssetId]
    )
    )
    )