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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
njxfoster
Helper I
Helper I

Distinct count with date parameter

Hi Guys

 

I want to create a distinct count for cancel note

 

njxfoster_1-1646085397249.png

These "Request from Management - pick up resource hours" should only be count once since it's all from the same date but different shift.

 

However, If I only use distinct count in this situation. "Request from Management - pick up resource hours" from other date will all count as only one note in total

 

 

Is there anyway I can count this cancel note also with parameter of different date so "Request from Management - pick up resource hours" from other date will count seperatly?

 

 

Thanks In advance.

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi,   @njxfoster 

The sample data you share is not representative, Does the cancel_note column have only one value? The same agent_name appears on only one day? Please describe your needs completely without your subjective operational awareness. In this way we can give an accurate formula. 

vjaneygmsft_0-1646277254341.png

Do you want to count how many different dates have cancel_note under the current agent_name?

 

Best Regards,
Community Support Team _ Janey

 

 

Whitewater100
Solution Sage
Solution Sage

Hello:

What is your expected result?

Can you try for the first measure:

Cancel Note CT = DISTINCTCOUNTNOBLANK(Count_Table[Cancel_Note])
 
Then to Count the days :
Count Measure = SUMX(
VALUES(Count_Table[shift]),
[Cancel Note CT])
 
Whitewater100_0-1646134659631.png

 

Hi! Thank you for your answer

 

For example:

njxfoster_0-1646255680364.png

If I use distinctcountnoblank. the result for "request from managemnt" will only show 1 

 

I want to add condition to the measure so it count this "request from management" as 3 since there are three different agents who share same cancel reason.

 

 

OK. You can put calc column in table:

Count =
var _name = Data[Name]
var _note = Data[Cancel_Note]
return
COUNTX(
FILTER(
ALL(Data),
Data[Cancel_Note] = _note &&
Data[Name] = _name)
, Data[Cancel_Note])
 
Then measure:
Manager CT = CALCULATE(DISTINCTCOUNT(Data[Name]),
Data[Count] >0)
 
Does this work for what you need?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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