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
EgbertMellema
Regular Visitor

Filter Unique id's on a measure?

Hi Again,

 

I have a measure that calculate's a number of calls in a time-slot:

 

number of calls in time-slot =
COUNTROWS( FILTER( 'asterisk cdr' ,
'asterisk cdr'[Starttime] >= MIN( Tijdslot[Starttijd] )
&&
'asterisk cdr'[Starttime] < MAX( Tijdslot[Eindtijd] )
)
)
 
This returns a lot of calls because 1 call can have for example 5 rows. 
1 call will always have 1 unique ID...
 
The first thing I do with the time slot measure is calculate it so I only have results for 1 day:
 
number incoming today =
CALCULATE( [number of calls in time-slot] ,
FILTER(ALL( Datumtabel ) ,
Datumtabel[Date] = TODAY()
)
)
 
Then my challenge:
Ik want to filter number incoming today  on unique id's... So I get the real numer of calls as a result.

So:
I would like to calculate the unique caller ID's in the time-slot....

Hope I describe it right so you guys understand it. If not pleas let me know!

Thanks in advance,
Egbert
 
1 ACCEPTED SOLUTION

Try:

 

number of calls in time-slot = CALCULATE(DISTINCTCOUNT('asterisk cdr'[UniqueId]),FILTER( 'asterisk cdr' ,
'asterisk cdr'[Starttime] >= MIN( Tijdslot[Starttijd] )
&&
'asterisk cdr'[Starttime] < MAX( Tijdslot[Eindtijd] )
)
)
 

View solution in original post

5 REPLIES 5
PC2790
Community Champion
Community Champion

Hello @EgbertMellema ,

 

You can consider using DISTINCTCOUNT instead of COUNTROWS which will give the count of unique records.

See if it fulfills your requirement.

I found a way....

Here's what I did:

 

number of unique calls in timeslot =
VAR uniekeID = DISTINCTCOUNT( 'asterisk cdr'[uniqueid] )
VAR aantaloproepen = COUNTROWS( FILTER( 'asterisk cdr' ,
'asterisk cdr'[Starttime] >= MIN( Tijdslot[Starttijd] )
&&
'asterisk cdr'[Starttime] < MAX( Tijdslot[Eindtijd] )
)
)
RETURN
[Unieke Id's]

With this measure I can do the trick!

Sorry, I cheered to early... Does not work yet, but I will keep on trying.,...

Try:

 

number of calls in time-slot = CALCULATE(DISTINCTCOUNT('asterisk cdr'[UniqueId]),FILTER( 'asterisk cdr' ,
'asterisk cdr'[Starttime] >= MIN( Tijdslot[Starttijd] )
&&
'asterisk cdr'[Starttime] < MAX( Tijdslot[Eindtijd] )
)
)
 

Yes! That's it. 

Thanks very much!

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.