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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count Rows Function works only for one category

Hi all, I have an appended query where all the models of 5 products are listed in the [Model] column with other columns like [Update Date]. I have created a count function that counts the same Models by same Update Date. 

 

Count = CALCULATE( COUNT('Group'[Model]), ALLEXCEPT('Group','Group'[Update Date], 'Group'[Model]))
 

To show the results, I use a table with the category name, the model, and the due date. 

The count function (which is a measure created in the appended query) works only for one category, for example it works for bicycles and not for e-bikes. It means that the count is right for bicycles and not for the e-bikes. See below the problem, same model for e-bikes and same update date but they are not grouped together like the bicycles.

 

CategoryModelUpdate DateCount
BicycleRoss31/12/20211
BicycleGas28/12/20212
BicycleRino31/12/20211
e-bikesGogo12/12/20212
e-bikesGogo12/12/20212

 

For each rows, if I select one, it displays the serial number and additional infos in another table. If the count is 2 per same model and same Update Date, it shows two rows in the other tables. 

The product categories are five in total, but in the table filter I have selected bicycles and e-bikes, which are the only products that I want to check the Update Date. 

Why the count works for one category and not for the other? I have tried to change the measures many times, but I have not found a working solution.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I solved the issue: in the table with the category, model, Update Date, and Count, I had the serial number column. By remove it, the count works. I think that the serial number column was filtering in the measure in some way. Thanks for your support.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I solved the issue: in the table with the category, model, Update Date, and Count, I had the serial number column. By remove it, the count works. I think that the serial number column was filtering in the measure in some way. Thanks for your support.

@Anonymous , Kudos to you !!

PaulDBrown
Community Champion
Community Champion

Can you please provide sample data?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

How can I upload the sample data? I cannot find any insert file button in the reply message box. sorry.

 

amitchandak
Super User
Super User

@Anonymous , what is the expected output?

 

If this is a column try like

 


Count = CALCULATE( COUNT('Group'[Model]), filter('Group','Group'[Update Date] = earlier([Update Date] ) && 'Group'[Model] = earlier('Group'[Model])))

 

if measure , try like

Count = CALCULATE( COUNT('Group'[Model]), filter(allselected('Group'),'Group'[Update Date] = max([Update Date] ) && 'Group'[Model] = max('Group'[Model])))

Anonymous
Not applicable

Thanks for your help. I have tried the measure you posted and the result is the same: it works for the bycicle category and not for the e-bikes category. 

 

The expected output is like the table in the first post with the correct e-bikes count per same model and same Update date. The table shows that there are 2 e-bikes with Go-go model and 12/12/2021 update date, the count is right but they are not grouped in one row.

@Anonymous , if the date does not have timestamp, in table visual both rows should merge. Even for simple count like below example

 

amitchandak_0-1632740693932.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors