Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Need help creating a custom table/summarized table(not a visual) from the existing data

Hi,  I have a data table which has details of order number, date, tickets, category of tickets and their prices and i need help to create a custom table/summarized table which categorises the ticket...
  • 123abc's avatar
    1 year ago

    You can try below in Power BI, go to the "Modeling" tab and click on "New Table." Use the following DAX code as an example:

     

    NewSummaryTable =
    SUMMARIZE(
    DataTable,
    DataTable[Customer Number],
    "Total Tickets", SUM(DataTable[Total Tickets]),
    "Paid Tickets", SUM(DataTable[Paid Tickets]),
    "Complimentary Tickets", SUM(DataTable[Complimentary Tickets]),
    "Adult", SUMX(FILTER(DataTable, DataTable[Ticket Type] = "Adult"), DataTable[Tickets]),
    "Kids", SUMX(FILTER(DataTable, DataTable[Ticket Type] = "Kids"), DataTable[Tickets]),
    "Fan Club", SUMX(FILTER(DataTable, DataTable[Ticket Type] = "Fan Club"), DataTable[Tickets]),
    "Visiting Team", SUMX(FILTER(DataTable, DataTable[Ticket Type] = "Visiting Team"), DataTable[Tickets]),
    "Players and Club Guests", SUMX(FILTER(DataTable, DataTable[Ticket Type] = "Players and Club Guests"), DataTable[Tickets])
    )

     

    This will generate a summarized table with the breakdown of ticket counts per type for each customer.