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

Measure that will sum how many times an Item ID appeared in one day

I have the following table:

 

Item ID

Date

6

01/01/2020

6

01/01/2020

7

01/01/2020

7

01/01/2020

7

01/01/2020

5

02/02/2020

6

02/02/2020

6

02/02/2020

6

02/02/2020

7

02/02/2020

 

I need to create a measure that will sum how many times an Item ID appeared in one day so I can have a table like this:

 

Date

Item ID

Instances

01/01/2020

6

2

01/01/2020

7

3

02/02/2020

5

1

02/02/2020

6

3

02/02/2020

7

1

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , That you can have a simple count measure

count(Table[Item ID])

But you need a sum of distinct ID on a date, you need like this

sumx(values(Table[Date]), distinctcount(Table[Item ID]))

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a measure like this:

Measure = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Date],'Table'[Item]))

test_Measure that will sum how many times an Item ID appeared in one day.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , That you can have a simple count measure

count(Table[Item ID])

But you need a sum of distinct ID on a date, you need like this

sumx(values(Table[Date]), distinctcount(Table[Item ID]))

mahoneypat
Employee
Employee

You should be able to make a table visual that has Date and Item ID, and then add either column again but with an aggregation of count.  Or you can make a measure like ID Count = COUNT(Table[Item ID]) and add that.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.