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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
michael_knight
Post Prodigy
Post Prodigy

Distinct Count with multiple criterias

Hi,

 

I am trying to replicate the following below in Excel into Power BI. Basically I need to do an ALLEXCEPT of some sort with the Membership, check if the Worry Date is not blank and then if on any row the Mandatory is set to 'Yes' then return 'TRUE'

 

MembershipInterview DateMandatoryWorry DateResult
11102/12/2021No15/11/2021TRUE
11125/11/2021No15/11/2021TRUE
11123/11/2021Yes15/11/2021TRUE
11115/11/2021No15/11/2021TRUE
11109/11/2021No  
11102/11/2021No  
11129/10/2021No  
11122/10/2021No  
11115/10/2021No  
11107/10/2021No  
11130/09/2021No  
22223/09/2021No23/08/2021FALSE
22217/09/2021No23/08/2021FALSE
22206/09/2021No23/08/2021FALSE
22223/08/2021No23/08/2021FALSE
22223/08/2021No23/08/2021FALSE
22218/08/2021   
22209/08/2021   
22229/07/2021   
22219/07/2021   
22212/07/2021   
22209/07/2021   
22205/07/2021   
22202/07/2021   

 

Does anyone know how I can do this?

 

Thanks,

Mike

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi  @michael_knight ,

 

Please try:

Result = 
var _t=SUMMARIZE(FILTER('Table',[Membership]=EARLIER('Table'[Membership])&&  [Worry Date]<>BLANK()  &&[Worry Date]=EARLIER('Table'[Worry Date])),[Mandatory])
return  IF("Yes" in _t, TRUE(),FALSE())

Output:

Eyelyn9_0-1638856637585.png

 

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi  @michael_knight ,

 

Please try:

Result = 
var _t=SUMMARIZE(FILTER('Table',[Membership]=EARLIER('Table'[Membership])&&  [Worry Date]<>BLANK()  &&[Worry Date]=EARLIER('Table'[Worry Date])),[Mandatory])
return  IF("Yes" in _t, TRUE(),FALSE())

Output:

Eyelyn9_0-1638856637585.png

 

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

amitchandak
Super User
Super User

@michael_knight , Try a new column like

 

new column =
var _cnt = countX(filter(Table, not(isblank([Worry Date])) && [Membership] = earlier([Membership]) && [Mandatory] ="Yes"),[Membership])
return
if(isblank(_cnt), false(), True())

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.