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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Counting Transaction Status

The goal is to the create a table that will count the number of transactions with regards to the current status and total. Example if you order a pizza, the status of the pizza will go from: new > build in progress > baking > boxing > complete. There are 5 status' to the transaction and the price does not change. Problem is my current measure can count the status' per transaction but it cannot distinguish what is complete vs outstanding (ex: pizza1 [current count output = 1 Complete / 4 Outstanding] vs. pizza1 should = 5 Complete because the last status is Complete ). How do we count the number of actions + total sale considering the current status and price? How would you approach this scenario? 

 

Below are sample data to give context (table 1 = sample data / table 2 = desired output)

(Table 1 = Sample Data)

transaction_idtransaction_datestatusprice
pizza1Wed. Nov 25, 2020New$5.00
pizza1Fri. Nov 27, 2020In Progress$5.00
pizza1Mon. Nov 30, 2020Baking$5.00
pizza1Tue. Dec 1, 2020Boxing$5.00
pizza1Fri. Dec 4, 2020Complete$5.00
pizza2Thu. Nov 26, 2020New$12.00
pizza3Wed. Dec 2, 2020New$10.00
pizza3Wed. Dec 2, 2020In Progress

$10.00

pizza3Thu. Dec 3, 2020Complete

$10.00

pizza4Mon. Nov 30, 2020New

$5.00

pizza4Fri. Dec 4, 2020Canceled

$5.00

(Table 2 = Desired Output)

transaction_idtransaction_countstatus_countcurrent_statustotal_pricecompleted_priceoutstanding_price
pizza115Complete$5.00$5.00$0.00
pizza211New$12.00$0.00$12.00
pizza313Complete$10.00$10.00$0.00
pizza412Delete$5.00$0.00$5.00

Any advice is greatly appreicated

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Please download this PBIX file with data and code to produce this table

pizza.png

There are 2 things to mention.

I've deliberately left out the Transaction_Count column as this always appears to be 1.  Each transaction will be unique?  I can add this in if needed.

For Cancelled orders your final table shows the Current_Status as Delete.  I've left it as Canceled but again, can change this if needed.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @Anonymous 

Please download this PBIX file with data and code to produce this table

pizza.png

There are 2 things to mention.

I've deliberately left out the Transaction_Count column as this always appears to be 1.  Each transaction will be unique?  I can add this in if needed.

For Cancelled orders your final table shows the Current_Status as Delete.  I've left it as Canceled but again, can change this if needed.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors