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! Request now

Reply
Anonymous
Not applicable

Proper Filtering Context for Distinctcounts

Hello,

 

I have a table with a handful of columns that offer information about the transactional history of a case. The Case Number, the Time of Entry into Queue and AssignTime are the primary columns of interest. There are instances when a case may enter the queue at different times throughout its lifecycle and instances in which, despite an attempt to assign the case, it never gets assigned from the queue. The latter will result in a null value within the AssignTime column:

 

Case Number                   Time of Entry                   AssignTime

12345                                1:02:34 AM

12345                                1:02:34 AM                      3:45:13 AM

12345                                7:45:20 PM                                                   

23456                                6:20:58 AM                     

23456                                7:17:23 AM

23456                                7:17:23 AM

34567                                3:10:45 PM                      

34567                                3:10:45 PM                       4:20:14 PM

98765                                5:13:13 AM       

 

In summary, there are 4 distinct cases and I want to show that 2 of the 4 were never assigned. I need to keep the rows that do not have an Assigntime indication as they include other information that is included in different measures within the report. Any help is appreciated.

 

Thank you,

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

@Anonymous

 

Here is a simple measure that should do what you want:

Cases Never Assigned =
COUNTROWS (
    FILTER (
        VALUES ( YourTable[Case Number] ),
        ISBLANK ( CALCULATE ( MAX ( YourTable[AssignTime] ) ) )
    )
)

The measure counts the number of Case Numbers where the maximum AssignTime is blank, indicating that there is no AssignTime.

You could possibly do something with SELECTEDVALUE but I think this measure is good enough.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

Drag Case Number to the visual and write the following measure

 

=if(COUNTBLANK(Data[AssignTime])=COUNTROWS(Data),1,BLANK())

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you Ashish.

You are welcome.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
OwenAuger
Super User
Super User

@Anonymous

 

Here is a simple measure that should do what you want:

Cases Never Assigned =
COUNTROWS (
    FILTER (
        VALUES ( YourTable[Case Number] ),
        ISBLANK ( CALCULATE ( MAX ( YourTable[AssignTime] ) ) )
    )
)

The measure counts the number of Case Numbers where the maximum AssignTime is blank, indicating that there is no AssignTime.

You could possibly do something with SELECTEDVALUE but I think this measure is good enough.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Anonymous
Not applicable

Thanks Owen - this works great. Appreciate the help.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,


In summary, there are 4 distinct cases and I want to show that 2 of the 4 were never assigned. I need to keep the rows that do not have an Assigntime indication as they include other information that is included in different measures within the report. Any help is appreciated.

 


 

I would appreciated if you could share your expected output, so that we can help further investigate on it?

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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