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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pmh_001
Regular Visitor

How can I group unique column values into counts by date?

I have a table of transaction records that includes 2 columns: DateOfTransaction, and ItemNumber. Each time a transaction occurs, the date and item number are logged into the table. There are multiple transactions per day, sometimes with the same items being sold in seperate transactions. There are over 500 days in my table. I want to be able to group my data so my dates stay chronological, and a new column is created that displays the count of each ItemNumber that was sold for that day.

 

For example, this is what I have:

 

      Date         ItemNumber

05/20/2021    SGHH123
05/20/2021    APJ984
05/20/2021    SGHH123
05/21/2021    APJ984
05/21/2021    APJ984

 

And this is what I want:

 

 Date          ItemNumber    ItemNumberCount

05/20/2021 SGHH123    2
05/20/2021 APJ984    1
05/21/2021 APJ984    2

 

I'm very stumped on how to achieve this result. Thank you so much in advance!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@pmh_001 add a measure and drop this in the table visual:

 

Item Number Count = COUNTROWS ( YouTable )

 

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@pmh_001 add a measure and drop this in the table visual:

 

Item Number Count = COUNTROWS ( YouTable )

 

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

This worked! Thank you.

Ashish_Mathur
Super User
Super User

Hi,

Drag the two fields to a Table visual and write this measure

Measure 1 = countrows(data)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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