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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count distinct start dates by item

Dear all, 

 

I have an issue with counting all distinct start dates per item (id). 

 

f.e. of the data 

ID datestart or stop date
112/02/2024start
114/02/2024stop 
15/02/2024start
116/02/2024stop
205/03/2024start
205/03/2024stop 
205/03/2024start
205/03/2024stop 
310/06/2024start
310/06/2024stop 
410/06/2024start
410/06/2024stop 

 

 

i am trying to make a table that has following info (only the start dates per item - and total amount of start dates that each item has) 

ID test datestart or stop datecount amount of days tested
112/02/2024start2
15/02/2024start2
205/03/2024start1
310/06/2024start1
410/06/2024start1

I dont really need to start or stop column but i kept it here as en example. 

now i only have "1" everytime i try to calculate how many distinct dates there are, but if i remove the date column it does calculate correctly the distinctdates, with filter that start stop column = start. 

 

Count amount of days tested = 

CALCULATE (
DISTINCTCOUNT (
'table'[test date] ) , 
FILTER ('table', 'table'[start or stop] = "start") ) 

 

Afterwards I want to be able to make a percentage with all the ID that have more then 1 (or only 1 test date) test date over ( / ) all ID in total. So i can see a percentage of how many ID were only tested once.  

 

how should change this calculation? 

 kind regards 

 

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

 

You can try below steps to create calculated column and calculated table to get result:

StartDatesOnly = 
FILTER(
    'table',
    'table'[start or stop date] = "start"
)
Count of Start Dates = 
CALCULATE(
    DISTINCTCOUNT('StartDatesOnly'[date]),
    ALLEXCEPT('StartDatesOnly', 'StartDatesOnly'[ID])
)

 

vkongfanfmsft_0-1720770597711.png

FinalTable = 
SUMMARIZE(
    'StartDatesOnly',
    'StartDatesOnly'[ID],
    'StartDatesOnly'[date],
    "count amount of days tested", COUNT(StartDatesOnly[Count of Start Dates])
)

vkongfanfmsft_1-1720770623245.png

 

Best Regards,
Adamk Kong

 

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

Anonymous
Not applicable

I have following error with the calculated column: 

StartDatesOnly = 
FILTER(
    'table',
    'table'[start or stop date] = "start"
)

The Expression refers to multiple columns, multiple columns cannot be converted to a scalar value

 

the start and stop column is a column i made using the first charachters of another column which had a whole start stop sentence. could that be the problem? do i need to refer to the original column? 

 

 

Anonymous
Not applicable

I am quite new to this forum ... i unfortunately cant share the power bi since it has confidential information and is a big report with mutiple tabs and views of data. Do you need more info?

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.