Forum Discussion
Need help creating a custom table/summarized table(not a visual) from the existing data
- 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.
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.
Thank you, I'll try this 🙂
- 123abc1 year ago
Community Champion
Sure ... contacht with me if you have any issue regarding this .