Forum Discussion

mbowler's avatar
mbowler
Helper I
2 years ago
Solved

Creating Average measures for table

I have a table of ticket sales for different events, each row is a seat. If the seat is still available the "Price" column is empty. I have created a couple of measures that give me the number of tic...
  • AlexisOlson's avatar
    2 years ago

    First aggregate at the level you need for your business logic, then use AVERAGEX. If event is the granularity you want to average at, try this:

     

    Event Avg Count =
    VAR __Events =
        SUMMARIZE (
            AllSeatsData,
            AllSeatsData[Event Instance ID],
            "@Count", COUNTA ( AllSeatsData[Price] )
        )
    RETURN
        AVERAGEX ( __Events, [@Count] )