Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tvycho
Regular Visitor

Process a table with some values to sum and some not to

Dear all,

 

I struggle with a table of sales that I need to process, and I am quite new to all this, so I may even describe things incorrectly, sorry for that. I kindly ask you to help me with my issue.

 

I have a dataset from our box office that sells either a single ticket (the last line 10466714072 in the example below) or a combo ticket (all previous tickets). However, the box stores the data in a strange way: it devides the price of combo tickets to three entries but it copies the number of people in all three.

 

Here is a sample of the original dataset:

 

TICKET_IDNUM_PEOPLEPRICE
10466713925 40
10466713925 4215
10466713925 4215
10466713941 20
10466713941 2195
10466713941 2195
10466714008 20
10466714008 2220
10466714008 2220
10466714072 3840

 

And here is my desired result, where I sum the prices but not the people. For further analysis, I also need to distinguish between a single and a combo ticket, as in the COMBO column (0=single, 1=combo). You can only tell the entry is a single ticket by having a single row, whereas combo tickets are in three lines:

 

TICKET_IDNUM_PEOPLEPRICECOMBO
10466713925 44301
10466713941 23901
10466714008 24401
10466714072 38400

 

Could you please suggest a way how to do this? Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tvycho ,

 

Please create a new measure:

COMBO = IF(ISODD(SUM('Table'[NUM_PEOPLE])),0,1)

Output:

vcgaomsft_0-1691653873758.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @tvycho ,

 

Please create a new measure:

COMBO = IF(ISODD(SUM('Table'[NUM_PEOPLE])),0,1)

Output:

vcgaomsft_0-1691653873758.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Dear Gao,

 

thank you! Although I finally chose a different solution (a new column with a combination of SUMMERIZE, IF, SUM and COUNT), your solution inspired me a lot and change my perpective (and it did work, I just decided to choose a different path later).

 

All the best

 

Tomáš

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors