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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
leahschneider
Helper III
Helper III

Count Rows where not in Previous Period

I have a visual that sums total sales for a product category over time. For each period (usually month), I would like to sum the total number of product categories that aren't in the previous period. 

Example Raw Data:

DateCategoryProductTotal
31-JanElectronicsWatch43
31-JanClothesShirt254
31-JanClothesHat478
31-JanMiscGiftcard2
28-FebGearBike24
28-FebGearHelmet3
28-FebElectronicsWatch25
28-FebClothesShirt576
31-MarGearBike15
31-MarElectronicsWatch3
31-MarMiscGiftcard1

 

Desired Results:

DateNew Category CountExplanation
31-Jan The first date doesn't matter. It can also say 4.
28-Feb1Gear is not in January products.
31-Mar1Misc is not in February products. It is in January, but that should not affect this calculation.

 

 

I do not know why this doesn't let me make tables that are usable looking. This is a picture of what I have and what I want:

leahschneider_0-1678224144169.png

 

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

It's, in essence, nothing but an question of MoM comparison.

CNENFRNL_0-1678230149575.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thank you this is very helpful. I had wanted count and not concat but that's pretty easy to fix. My only issue with this is that it's not possible to group up. If I want to add quarter or year to the table, it won't work correctly on quarter or year.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.