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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jamesonct
Regular Visitor

Average distinct count of date field

Hi all,

 

Here's what I'm trying to do:

 

I want to create a mesaure to get the distinct count of a column called 'Item Data'[Item Status].  With that distinct count, I want to average the number of items received per week by a column called 'Item Data'[Creation Date] for the last 365 days.

 

Can someone help me out with this?

 

Thank you!

6 REPLIES 6
jamesonct
Regular Visitor

So lets say I do this:

 

I think I may have mispoke.  I believe I want count not distinct count.  I'm still learning.

 

AvgNumberItemsWeek = COUNT('Item Data'[Item Status])

 

And filter Creation Date by relative date in the last 365 days, I get 2118 count of item status.  What I want to do is take that count and then average it out to items per week.

 

The data I'm working with looks like this:

 

Screenshot 2024-04-01 172121.jpg

 

PowerBI.jpg

it's better to provide some dummy data. if the solution works, then apply it to your real data. Otherwise it's very hard to provide the proper solution





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Got it.  Here's some dummy data:

 

Item CodeLab Case NumberSubmitting AgencyIncident/Case NumberCase OfficerCase TypeItem TypeItem StatusLocationItem DescriptionDanger FlagCreation DateModified Date
T1234TEST-2024-00001Generic Agency Name123345J. DoeN/AUSB Flash DrivePending AnalysisLoc1Item 1'- Not Dangerous -3/28/2024 15:083/28/2024 15:08
T1235TEST-2024-00002Generic Agency Name123345J. DoeN/ASIM CardPending Return to DepartmentLoc2Item 2'- Not Dangerous -3/28/2024 14:513/28/2024 14:51
T1236TEST-2024-00003Generic Agency Name123345J. DoeN/AUSB Flash DrivePending AnalysisLoc3Item 3'- Not Dangerous -3/28/2024 13:503/28/2024 14:19
T1237TEST-2024-00004Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc4Item 4'- Not Dangerous -3/28/2024 13:313/28/2024 13:35
T1238TEST-2024-00005Generic Agency Name123345J. DoeN/ATabletPending AnalysisLoc5Item 5'- Not Dangerous -3/28/2024 12:173/28/2024 12:42
T1239TEST-2024-00006Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc6Item 6'- Not Dangerous -3/28/2024 12:173/28/2024 12:39
T1240TEST-2024-00007Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc7Item 7'- Not Dangerous -3/28/2024 12:173/28/2024 12:39
T1241TEST-2024-00008Generic Agency Name123345J. DoeN/ATabletPending AnalysisLoc8Item 8'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1242TEST-2024-00009Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc9Item 9'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1243TEST-2024-00010Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc10Item 10'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1244TEST-2024-00011Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc11Item 11'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1245TEST-2024-00012Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc12Item 12'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1246TEST-2024-00013Generic Agency Name123345J. DoeN/AOtherPending AnalysisLoc13Item 13'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1247TEST-2024-00014Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc14Item 14'- Not Dangerous -3/28/2024 12:163/28/2024 12:39
T1248TEST-2024-00015Generic Agency Name123345J. DoeN/APhonePending AnalysisLoc15Item 15'- Not Dangerous -3/28/2024 12:113/28/2024 12:40
T1249TEST-2024-00016Generic Agency Name123345J. DoeN/AComputerPending AnalysisLoc16Item 16'- Not Dangerous -3/28/2024 9:043/28/2024 9:07
T1250TEST-2024-00017Generic Agency Name123345J. DoeN/AUSB Flash DriveChecked OutLoc17Item 17'- Not Dangerous -3/28/2024 8:243/28/2024 12:03
T1251TEST-2024-00018Generic Agency Name123345J. DoeN/AUSB Flash DrivePending Return to DepartmentLoc18Item 18'- Not Dangerous -3/28/2024 5:493/28/2024 5:56

what's the expected output based on the dummy data you provided?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




1) Get a count of the rows

2) Average that count using the 'Creation Date' column for the last 180 days.

ryan_mayu
Super User
Super User

could you pls proivde some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors