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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Vsthesound
Frequent Visitor

Count of rows with condition and grouping by Customer ID to return one figure

Hey guys, I really need help with this dataset,its giving me serious headaches. I want to Count the number of times each 'Account Number' subscribed within 6 months.

I am having serious issue GROUPING each 'AccountNumber' to return one figure (i.e No of times/Count of Data subscribed within 6 months). Please see dataset preview below and kindly assist. Thank you.

Vsthesound_0-1664850262000.png

Your swift response is highly appreciated.

1 ACCEPTED SOLUTION

@Vsthesound 
If you create it as a measure it should give you the expected result. Please try and share a screenshot of the results

View solution in original post

8 REPLIES 8
Vsthesound
Frequent Visitor

Thank you so much. The data for each account is strictly for 6 months only. If you refer to the image on very my first post, you will see that the dates for each account ranges from July-December 2019.

 

Hi @Vsthesound 
Then just use 
COUNT = COUNTROWS ( 'Table' )

This formula just counts all the rows on the table. I need a formula that counts the rows and group them by account number , for every time the account subscribed within 6 months.

The maximum number of expected Count for an account that subscribed 6times out of 6 months = 6

Count for an account that subscribed 5times out of 6 months = 5

Count for an account that subscribed 4times out of 6 months = 4

etc.

I hope this explains it better.

 

@Vsthesound 
If you create it as a measure it should give you the expected result. Please try and share a screenshot of the results

It worked!. Thank you so much😁.

Vsthesound_0-1664902356962.png

 

tamerj1
Super User
Super User

Hi @Vsthesound 

would you please provide the expected results based on the the same sample data?

Expected result should be 

Account Number         Count/No of Times Subscribed in  6 months

     1000001                                                   6

     1000002                                                   6

Vsthesound_0-1664853961089.png

 

@Vsthesound 

what if the data for an account contains more than 6 months? A year for example? Which 6 months shall be considered? I'm asking this because as per your example, COUNTROWS ( 'Table' ) shall do the job but I don't think you actual requirement is just as simple as that, is it?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.