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

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