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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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])))

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])))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors