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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

DISTINCTCOUNT of items and sum by previous month

Hi,

 

I want to create a DAX that can count the total of items and sum it by the previous month. As an example,

 

ItemIDReceiveDate
A101/01/2020
A201/02/2020
A101/02/2020
B301/03/2020

 

Count of items and sum it by prev month,, (Jan, Jan+Feb, Jan+Mar,etc.) without creating a new table. I just need the CumulativeItemsCount field. ItemsCount is just a sample.

 

ReceiveDateMonthItemsCountCumulativeItemsCount
Jan11
Feb23
Mar14

 

Do I need to create a column that has the rank of the items filtered by the year and month before proceed with the CumulativeItemsCount column?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create count measure

Count Item = count(Table[ItemID])

or
Count Item = distinctcount(Table[ItemID])

Then create a cumulative like

CumulativeItemsCount = calculate([Count Item], filter(allselected(Table]), Table[Date] <= Max(Table[Date])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Create count measure

Count Item = count(Table[ItemID])

or
Count Item = distinctcount(Table[ItemID])

Then create a cumulative like

CumulativeItemsCount = calculate([Count Item], filter(allselected(Table]), Table[Date] <= Max(Table[Date])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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