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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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.

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @njxfoster ,

 

Try to create a measure like below:

Measure = 
var min_time = CALCULATE(MIN('Table'[Time]),ALLSELECTED('Table'[Time]))
return CALCULATE(DISTINCTCOUNT('Table'[Note]),FILTER('Table',min_time='Table'[Time]))

Vlianlmsft_0-1646277329548.png

 

If I misunderstand what you mean, could you provide the results you expect?


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

View solution in original post

3 REPLIES 3
TheoC
Super User
Super User

Hi @njxfoster 

 

Can you try the following measure:

 

DCount By Cat = CALCULATE ( DISTINCTCOUNT ( 'Table'[Cancel_Note] ) , ALLEXCEPT ( 'Table' , 'Table'[Date] ) )

 

If the filtering category changes (i.e. Date), you can just change it or you can add to it by adding a comma and 'Table'[Category2] after the 'Table'[Date]...

 

Hope this helps!

 

Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

V-lianl-msft
Community Support
Community Support

Hi @njxfoster ,

 

Try to create a measure like below:

Measure = 
var min_time = CALCULATE(MIN('Table'[Time]),ALLSELECTED('Table'[Time]))
return CALCULATE(DISTINCTCOUNT('Table'[Note]),FILTER('Table',min_time='Table'[Time]))

Vlianlmsft_0-1646277329548.png

 

If I misunderstand what you mean, could you provide the results you expect?


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

TheoC
Super User
Super User

Hi @njxfoster 

 

Can you try the following measure:

 

DCount By Cat = CALCULATE ( DISTINCTCOUNT ( 'Table'[Cancel_Note] ) , ALLEXCEPT ( 'Table' , 'Table'[Date] ) )

 

If the filtering category changes (i.e. Date), you can just change it or you can add to it by adding a comma and 'Table'[Category2] after the 'Table'[Date]...

 

Hope this helps!

 

Theo 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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